Lily first showed up in EP241, where she basically conscripted Ash and the gang into helping her track down ingredients for a spell. Her goal was pretty ambitious—she wanted to create magic that would let humans understand what Pokémon were actually saying. Seemed like a solid plan until she actually cast it and, whoops, turned Ash into a Pikachu instead.
Content compiled by AnimeList.moe from publicly available sources.