Have your cake and eat it too is a saying that means to get two good things at the same time. It's like saying you can get something and keep it, even though you use it up.
For example, it's like going to an ice cream shop and having the flavor you want for your ice cream, and then also getting to keep the ice cream cone afterwards! You can have the ice cream and still have the cone when you finish.