Pinkie you've got five minutes before the Cakes realize you're alone and they didn't lock away that cake behind a steel door. So, you've got plenty of time to hide the evidence.
So, I've got a theory that Pinkie is the Cakes' niece. After she got her cutie mark, her family realized a saddness mine- I mean a rock farm, wasn't the best place for someone who was destined for parties to grow up. Their relatives in Ponyville, the Cakes, had been trying for a long time to have kids of their own but without success. Seeing as they owned a bakery, the Pies figured that would be a far better environment for the future party pony and sent her along, the Cakes happily taking her in as an apprentice.
What they did NOT count on was Li'l Ponka's bottomless sugarlust, a hunger for sweets that could never be filled. Needless to say they quickly learned a few security measures, though things do slip through the cracks. It's an endless war of wits, with the prize being delectable treats Equestria has never seen before. The battle rages even to this day.