In the Toy Story 4 ending, Woody chooses to stay behind with Bo Peep and live as a lost toy rather than return to Bonnie's room, while Buzz and the others say a tearful goodbye and drive off in the RV. Spoilers follow.
The practical events are simple. Gabby Gabby finds a child of her own, which gives her the ending she wanted, and Woody, Bo and their friends carry on a new life helping other toys find owners. Bonnie also makes a companion for Forky from a plastic knife.
Why does Woody leave? In my opinion, the answer starts in the earlier films. In Toy Story 2 he is stolen by the collector Al McWhiggin and has to decide what a toy owes the child who loved him. In Toy Story 3, Andy is 17, the toys are headed for Sunnyside Daycare by mistake, and Woody is the one who knows Andy's real plan. Each film moves him a step further from the idea that a toy exists only for one kid. Toy Story 4 (2019) finishes that thought, and it is why the ending feels earned rather than sudden.
The voice box is the clearest piece of staging. Woody trades it to Gabby Gabby, whose own broken voice box has kept her from being chosen, so he gives up the thing that makes him a talking cowboy in order to help someone else. It could be argued that this is the moment he stops being Andy's or Bonnie's toy and becomes his own. Buzz then tells him to follow his heart, which reverses their first film, where Buzz was the one who had to learn he was a toy.
The two endings also mirror each other. Gabby gets a child by comforting a lost girl at the carnival, after Harmony rejected her, while Woody gets a purpose by helping prize toys find children. Compare that with the spin-off Lightyear, where Buzz spends years trying to undo one mistake, and Woody's choice looks like the opposite lesson: sometimes you stop fixing the past and start a new job.
The production history adds context. Josh Cooley became sole director after taking over the story from John Lasseter, and Rashida Jones and Will McCormack left the writing in November 2017, so the final screenplay credit goes to Stephany Folsom and Andrew Stanton. A story that changed hands that often could easily have ended on a safe return to Bonnie. Instead, the film commits to a goodbye, and Stanton later directed Toy Story 5, which brings Woody and Bo Peep back around.
Perhaps the bravest part is that Woody ends up as neither a loser nor a hero, only a toy with a new job. Whether that suits your family depends on how you feel about the goodbye, since the last scene with Buzz is emotional.