Get Prepared for Trouble!
If you've never seen Pokémon before, or it's been awhile, here's a quick refresher about Jessie, James, and Team Rocket, in the context of the TV show:
What Is Team Rocket?
Team Rocket, of which Jessie and James are but two members, is a Pokémon-stealing organization employing spy-like agents to track down and capture rare Pokémon. Giovanni, the mysterious head of the Team Rocket organization, uses teams like Jessie and James to bring back these rare Pokémon, to then sell or trade in various black market efforts.
The (Hilarious) Problem with Jessie and James
Team Rocket is set up for success--except that Jessie and James are two of the most bumbling would-be Pokémon thieves in existence. Though they try very hard to please Giovanni, they inevitably foul up every single plan they concoct, even when given specific orders. Yet, despite the stress and conflict this brings on them both, they are still traveling together, still striving to make "good" agents at last.
Why They Are Chasing Ash & His Friends
During the course of the first two episodes of the show, "Pokémon: I Choose You!" and "Pokémon Emergency!" Ash and Misty, the first two protagonists we meet, end up in the Viridian City Pokémon Center. Ash's Pikachu was wounded and exhausted by a fight with a flock of angered Spearow and needs immediate help. (Misty literally fished a fleeing Ash and Pikachu out of the water, and Ash borrowed--and destroyed--Misty's bike in his effort to get Pikachu to the Pokémon Center quicker.)
While all of this is happening, Jessie and James (acting more sinister than any other time in the series) take this opportunity to invade the Viridian City Pokémon Center in the name of Team Rocket. Their plan is to capture all the rarest Pokémon possible while the trainers are unaware and the Pokémon are weakened.
It's a good plan--except they haven't banked on a feisty kid and his temperamental Pikachu being there. Ash and his Pikachu, together with the Pokémon Center's alternative power source (a group of Pikachu), jump to the defense of the Center, and hand Team Rocket a shocking loss (sorry, couldn't resist!). This is but the first of many sound defeats Jessie and James suffer at the hands of Ash and company.
Because Ash's Pikachu was weakened and yet still able to send Team Rocket flying, Meowth, Jessie, and James conclude that there must be something extra-special about this Pikachu, and so they resolve to capture it and bring it back to Giovanni, to placate him and raise their standing in the organization. Thus go the next two seasons of the show!