Yes, Bonnie keeps her toys, and she keeps Lilypad too. Blaze returns Jessie and Bullseye to Bonnie, and the two girls start a friendship built on playing together. Lilypad is accepted into the group and shares the fun instead of taking Bonnie away from her toys. Reporting on the ending in The National points to technology helping kids connect as the theme, and the film backs that up by letting the tablet join the game.
In my opinion, the smartest choice is that Lilypad never becomes a villain. She believes she is helping, which is why her guilt on the donation truck lands. It could be argued that this makes the lesson gentler for children and more honest for the adults watching with them.
The series has built its stories on the same fear since the start: being replaced. In Toy Story (1995), Woody grows jealous when Buzz Lightyear arrives as Andy's new birthday gift. Lilypad is that new gift for a new decade, except that the threat is a screen and not another toy. What changes is the answer. Woody's rivalry with Buzz ends with the two of them as friends, and Jessie's campaign ends with the toy box expanding to make room for the newcomer.
The donation truck is a deliberate echo too. In Toy Story 3 (2010), the toys climb into a donation box headed for Sunnyside Daycare because they think Andy has thrown them away. Here, the one heading for the truck is Lilypad, and it is the toys who run after her. That reversal is the emotional hinge of the film: the toys, who spent that earlier film afraid of being given away, are the ones who refuse to give up on someone else.
The set piece that carries them to safety deserves a mention. The army of Buzzes that turn into drones is the payoff for the opening sequence of 50 Buzz Lightyears, which Stanton said did not change one frame from the pages he wrote years earlier. A gag that looks like a side story at the start becomes the rescue at the end, and I think that is the best piece of plotting in the film.
Woody's ending is quieter. He heads back out on the open road with Bo Peep, and a walkie-talkie lets him stay in touch with Buzz, Jessie and the rest of the gang. That follows on from Toy Story 4, where Woody meets Bo Peep again in a small town. Perhaps the nicest touch is that his road life does not cut him off from the friends he came up with.
Finally, does the ending set up another film? The credits scenes tease a high tech Zurg toy, but they do not confirm a sequel. For where that stands, see Toy Story 6.