After Sirius and Lupin reveal Ron’s pet rat, Scabbers, to actually be a long-thought dead Animagus named Peter Pettigrew, Peter is able to procure a wand and turn back into a rat after the group has left the Shrieking Shack. Before that, however, Sirius and Lupin, who had just found out Peter was alive and had betrayed Harry's parents, are about to kill Peter, but Harry steps in front and saves Pettigrew’s life.
On the way out of the Shrieking Shack, Ron and Lupin together had been preventing Peter from transforming back into a rat, but it was a full moon, and Lupin, who would take the Wolfsbane Potion ordinarily, had forgotten. As he transforms into a werewolf, he drops his wand. Unable to transform without one, Peter picks up Lupin’s wand, turns back into a rat, and disappears into the night. Thus, Peter Pettigrew is now able to return to his master, Lord Voldemort, setting the stage for what’s to come in the remaining four books.
What’s interesting is that Harry and Hermione had a chance to re-capture Peter after going back in time. But one of the primary laws of time travel—perhaps the primary law—is not to be seen. So to prevent them from being spotted, Hermione convinces Harry not to pursue Stabbers/Peter, and though they eventually save Sirius’s life and rescue Buckbeak the hippogriff, Peter escapes. Upon Harry telling Dumbledore that he thinks he has failed, Dumbledore corrects him, saying,
You did a very noble thing, in saving Pettigrew’s life. Pettigrew owes his life to you. You have sent Lord Voldemort a servant who is in your debt.