hello
Unlike what you would think the two words are a lot different in the meaning
Gateau comes from the German wastel and it means cake (to summarize)
Gater comes from old French and it's actually a pejorative word(that's why I said the 2 words are different)
Gater means to spoil and more precisely to ruin
gater un enfant = to spoil a kid = actually means to ruin him
we also say : la grêle a gater la vigne =hail ruined the vine
Even in english you might hear : don't eat before dinner you will spoil your appetite
meaning you will ruin your appetite
I hope this helps you