At first, in Harry Potter and the Prisoner of Azkaban, Harry is told that Peter Pettigrew was a friend of his father (James Potter) who confronted Sirius Black after the latter had betrayed Harry's parents. Sirius Black supposedly cursed Pettigrew, leaving only a finger behind and slaughtering a dozen-odd innocent Muggles at the same time. For this crime, Sirius Black was sent to the wizard prison, Azkaban.
At the end of that book, however, Sirius and Remus Lupin reveal that Pettigrew is an Animagus who takes the form of a small rat. Called "Wormtail", he had become the secret-keeper for James Potter and his wife Lily Evans when Harry was a baby, in hopes that Lord Voldemort would pursue Sirius Black instead. However, it turns out that Pettigrew always tries to find powerful friends; he betrayed the Potters to Voldemort in order to gain favor. During the confrontation with Sirius on that fateful night, it was actually Pettigrew who blasted the muggles and then transformed himself to escape with the other rats down into the sewers. He left behind a finger, successfully faking his own death and framing Sirius Black for his and the Potters' deaths. Since then, Pettigrew had masqueraded as Scabbers, the pet rat owned at first by Percy Weasley, then by Ron Weasley.
Pettigrew later faked his own death a second time, to avoid Crookshanks, who was trying to bring him to Sirius Black. After his capture in Harry Potter and the Prisoner of Azkaban, Pettigrew escaped Sirius and Lupin. He sought out and found Lord Voldemort, who was in hiding.
In Harry Potter and the Goblet of Fire, Pettigrew helped Lord Voldemort in an elaborate scheme to capture Harry Potter. Pettigrew then performed an elaborate spell which allowed Voldemort to return to the flesh, sacrificing his own hand in the process.