The ending of Shrek the Third gives the crown to Artie and lets Shrek accept fatherhood, which settles both worries the film opens with. Every plot turn is revealed below.
The sequence runs like this. At the theater showdown, Prince Charming's sword attack on Shrek misses, and Charming is beaten when Prince Artie speaks to the villains about being accepted and valued. Artie is then crowned king of Far Far Away, which frees Shrek and Princess Fiona from the throne. Merlin, whose island spell swapped Puss and Donkey in the first place, reverses the body swap but leaves their tails switched. Shrek stops fearing fatherhood, and the couple raise their triplets.
The choice to end the villain plot with a speech rather than a duel is the most telling decision. In my opinion, it fits the film's setup: Artie was introduced at Worcestershire Academy as insecure and unsure of himself, so a sword fight would have asked him to be someone else. Winning over Charming's recruits with words about acceptance lets him succeed as himself. Charming has spent the film collecting fairy tale villains by promising them the revenge they want, and Artie beats that pitch by offering them something different.
Shrek and Artie work as mirrors, and that is where the ending does its real work. Shrek runs from a throne he believes he cannot fill, while Artie believes nobody will value him. Both worries are resolved in the same scene: Artie is valued, and Shrek, freed from the crown, can turn to the family waiting at home. Fiona's pregnancy is the quiet clock under the whole story, and the closing image of the triplets pays it off.
The princesses sit apart from this arc. They escape through the prison wall by themselves, and Donkey and Puss, still in each other's bodies, free the captive fairy tale characters. By the time Shrek reaches the theater, the rescue work is already done, so the finale belongs to Artie rather than to a last-minute save by the title character. That is a change from a plot built around the hero arriving to rescue someone, and it gives the ensemble real weight.
The lingering tail swap is a deliberate loose thread played for a joke. It keeps the tone light after a climax built on a speech, and it gives Donkey and Puss the final laugh.
The behind-the-camera context matters for how the film lands. Chris Miller took over directing from Andrew Adamson, who directed Shrek and Shrek 2, according to Screen Daily, with Raman Hui as co-director. Adamson stayed on as executive producer and story writer, so the story credit still traces back to the earlier films. The film opened to an estimated $122 million, ahead of the $108 million Shrek 2 took, so audiences turned out in record numbers for this resolution. The next film in release order, Shrek Forever After, follows it.