Ash and company come to a very polluted city. Pikachu is feeling sick, but the Pokémon Center's power is off... power is off all over the city. Dangerous, as Pokémon in intensive care are at risk. Pikachu would rather go with Ash than stay at the Pokecenter, so the group charge off to investigate why the power is gone. They go to the powerplant, where a Magnemite is attracted to the sick Pikachu for some reason.
After Ash chases Magnemite off, a lot of Grimer appear. They have been multiplying and clogged up the power generator, which is why the power is off. Everyone runs away from the Grimer, but eventually, they have to fight. Pikachu, Magnemite, and a lot of Magnemite's electric friends ('mites and Magnetons) electrocute the Grimer hard and save themselves. Ash manages to actually capture the head of the Grimer, a large, unpleasant-smelling Muk. Pikachu now feels better, because its sickness was caused by a buildup of electric energy; now that it had released a lot, it was well.
When Team Rocket finally realises that Pikachu was sick (and attracting the Magnemite, for that matter) because it was magnetised, they try to steal it using a giant magnet. However, this now does nothing but catch lots of Magnemite/ton, as Pikachu is immune. -_-; This episode also had an environmental lesson; it was due to the pollution in the city that the Grimer had multiplied so much.