Can I have my cake and eat it too?
If we're literally talking about cake, definitely not. By eating the cake, you destroy it, and it would be very difficult to turn the same matter back into a cake afterwards, and it would likely not be exactly the same as the original cake. This statement is often used metaphorically to mean that you must choose between two mutually exclusive outcomes, especially if aspects of both outcomes are desirable.
How does this metaphor make sense? I can see eating cake being a desirable outcome, but having a cake is not particularly valuable without eating it as it is the cake's only use case.