The ending of Toy Story 2 means Woody picks a shorter, riskier life with Andy over a permanent place in a museum. In my opinion, that choice is the best argument the film makes for itself, because it turns a rescue plot into a decision about what a toy is for.
Here is what happens. Woody goes home rather than be preserved in Tokyo. Jessie and Bullseye join the family of toys in Andy's room, and Al McWhiggin's plan to sell the collection falls apart. Woody accepts that Andy will grow up one day, but he is happy to enjoy the time they have together, and the film closes on the toys back together at home.
So, why does it work? The museum offers exactly what the toys fear losing: no more being outgrown. Jessie and the others urge Woody to come to Japan, where the Woody's Roundup set would sit on display for good, and it could be argued that the Prospector's pitch is reasonable on paper. That is what gives it weight. The cost is also real, because the set is only complete with Woody, so staying with Andy means breaking up the only family of Roundup toys that exists. Then comes the escape through the airport baggage system, a set piece that gives the choice a physical price before the toys get home.
How does it compare with the first film? In toy story 1995, Woody's trouble is jealousy: Buzz arrives as Andy's new favorite and Woody feels replaced. Here the fear has grown up. Woody is no longer worried about who sits on the bed, he is worried about being outgrown at all, and the answer he reaches is acceptance rather than a win.
There is a production angle too. The project began in 1996 as a direct to video sequel and became a theatrical feature in early 1998, according to Animation World Network. I read the finished film as one that earned its bigger scale, because the emotional question stayed small and personal while the stakes around it grew.
The series then keeps paying off the choice. Toy Story 3 has a 17 year old Andy facing college, which is the moment Woody accepted would come. Toy Story 4 brings Bo Peep back into Woody's life. In Toy Story 5, Jessie, billed first, sets out to win Bonnie back from a tablet, which is a long way from the shelf where she waited in Al's apartment. A film that ends on a toy choosing to be played with sets that whole pattern in motion.