Ash's Metapod evolved from Ash's Caterpie after a battle with Meowth, Koffing and Jessie's Ekans, just as
Misty was about to apologize and thank it for its great job against Team Rocket. Metapod then evolved into a Butterfree while trying to protect Ash from a Beedrill.