Elegran
To me, it means wanting both sides of a choice - the literal meaning is eating your cake now, but also having it waiting in the cake-tin for eating in the future.
It means having a spouse and a family for everyday security, but also a lover for exciting passsionate secret meetings.
It means taking your pension as a lump sum and spending it all in one go on a long luxury round-the-world cruise, while at the same time it stays solidly invested to give you a generous income for the rest of your life.
There is another saying, too, that means almost the same thing - "He wants his bread buttered on both sides!"
To me Elegran both your cake reference and pension reference are what having your cake and eating it mean.
Your spouse and lover reference is not, but it is having your bread buttered on both sides. The two sayings mean different things