She pledged to "hope to fly" and stick a cupcake in her eye if she broke her promise to not tell anyone that Spike liked Rarity in the episode Green Isn't Your Color. Because she broke her Pinkie Promise, she gained the ability to fly and took a cupcake to her eye, it just took a while for it to happen!
I'm not saying it doesn't make sense, it's a really funny idea, I just don't know how I would come to that connection. I mean, I would have never had this idea, it's just very out there, but in a good way.
You know how the pinkie promise goes: "cross my heart, Hope to fly, stick a cupcake in my eye?"
Well, she said "hope to fly" and "stick a cupcake in my eye", she has been turned into a alicorn and now she can fly, and she broke the promise of sticking a cupcake in her eye when she could fly. Get it? XD