"You can't have your cake and eat it too" - is a very badly phrased proverb, for two reasons.
1. Having cake is intended to mean something like "hoarding", "retaining", or "continuing to possess" your cake.
Yet having a cake usually means to eat that cake - which meaning obliterates the point of the proverb...
Or rather makes it an oxymoron something like: "You can't both eat your cake, and eat it as well"...
Nonsense
2. "Eat it too" is spoiled by the double meaning of "too" when the word is heard but not read; which was how I first encountered this proverb, as a child.
The intended meaning is of course: "too" meaning "as well" or "at the same time".
But the other meaning of the sound "two" is the number - and this is just confusing.
To work properly the proverb would need to be made unambiguous; something like:
You can't both eat and keep a cake.