The narrator first starts out as a feral puppy. A few weeks later, after being nursed by their mother, a feral as well, the dog and his siblings Fast, Sister, and Hungry go outside of their den to explore the woods around them. Soon after, men come and capture them. The dogs arrive at a place called the Yard, where dozens of abandoned dogs reside under the guidance of a gentle old woman who the narrator calls Señora. The narrator, who is soon named Toby by Señora, adjusts to his new lifestyle. Later, the two men appear back with Toby's sister.
One day, many of the newer dogs at the Yard are whisked off to a building (a veterinarian office). Toby overhears a conversation between one of the men who works for Señora and the veterinarian regarding the number of dogs who are living at the Yard. The vet is concerned that she may have to alert law enforcement to close the Yard because of concerns over poor living conditions, but says that if the shelter can come up with a solution for the problem, she won't have to call law enforcement.
A new dog arrives, named Spike, who is very aggressive towards the other dogs. Not long after, animal control agents arrive, with orders to shut down the place due to poor sanitation and welfare conditions. Many dogs, including Toby, are subsequently euthanized.
Toby is reincarnated as a Golden Retriever and is feeding off of a new mother. A few weeks after birth, when Toby and his new brothers and sisters have matured enough, he and the others are allowed to play outside of the cage. Toby climbs up onto a table and bites the doorknob, successfully opening the gate to the outside world and leaving him to explore the real world.
A truck driver picks up Toby from the road and calls him "Fella." The man then drives to the bar. After the man has been gone for several hours, Toby begins suffering from heat exhaustion in the cab. However, a woman suddenly appears and breaks the car window. She then revives Toby with water from a water bottle. The woman then picks up Toby and brings him to her car, where she returns home with the puppy. The woman introduces Toby, renamed Bailey, to her son, Ethan, who is overjoyed and excited to finally have a puppy of his own. Over the summer, Bailey enjoys himself by playing with Ethan everyday. Bailey becomes accustomed to Ethan's school routine and the summer tradition of going to the Farm, where Ethan's grandparents live. Over the course of many years, Bailey lives a much fuller life with Ethan than he did as Toby. He accompanies Ethan through many difficulties, including arson by an unusual neighbor causing a permanently injured leg ending Ethan's athletic career.
Ethan goes to live with his grandparents at their farm in Michigan so he can be with his girlfriend Hannah and to finish his senior year in high school. Around that time, things were not going well in the family, with Ethan's injury, an eventual break up with Hannah, and a divorce between Ethan's parents. Soon after moving, Ethan goes off to college, leaving Bailey with infrequent visits from him during the holidays. Bailey's health starts to decline, with him taking naps very often and being weak. Soon, Ethan's mother and grandparents take him to the vet, where he is once again put down.
Bailey wakes up once again as a German shepherd. Bailey, who realizes that he is now a girl, is picked out and named Ellie by a police officer, named Jakob, and trained to be a search-and-rescue dog. After Jakob is wounded, Ellie is transferred to one of his colleagues, Maya. Ellie learns to work with Maya, and, when Maya marries her boyfriend, Albert, Ellie is taught to carry the ring down the aisle as ring-bearer. Eventually, Ellie dies once again, sure that she has finally fulfilled her purpose.
Much to her surprise, however, Ellie is born again, this time as a male Labrador retriever. Wendi, his new owner, is ecstatic with her new pet (whom she names Bear), but is unable to keep him because of a no-pet rule in the apartment building she resides in. Instead, she gives him to her mother, who is dating an alcoholic. The mother's boyfriend, fed up with the dog upon receiving a notice that he needs to provide better living conditions, ditches him on a country road. Bear recognizes his surroundings, having been there before with Ethan. Using the skills he learned as Ellie, Bear is able to trail the scent of one of the farm's animals to the Farm, where Ethan lives. Ethan, now an elderly man, decides to keep Bear, renamed Buddy, and gets married to Hannah. One day, while Hannah is out doing errands, Ethan has a seizure and begins to believe that Buddy is Bailey. Within hours he dies, and Buddy stays by him, finally alone with his old master again.