Rainbow Dash is preparing for the Best Young Flyer competition, so Twilight Sparkle casts a spell that gives Rarity temporary wings and the rest of them the ability to walk on clouds like Pegasi.
When Twilight uses her magic to give Rarity wings so that she can watch Rainbow Dash compete in a race, Rarity is so taken with her new ability that she disrupts the competition.