In the Shrek Forever After ending, Fiona's true love's kiss cancels Rumpelstiltskin's contract, the alternate timeline disappears, and Shrek returns to his children's birthday party, where he now hugs his family instead of losing his temper. As the sun rises, Shrek begins to fade, since the contract is about to take full effect. Fiona kisses him just before he disappears, and the altered world collapses.
The rules are simple, and they explain why Shrek does not simply return in the middle of the film. The contract can be cancelled only by true love's kiss before the day ends, and Fiona has no memory of him, so he has to earn the love that he already had. That is the emotional engine of the story, and in my opinion it is a clever way to make a fourth film feel like a fresh romance rather than a repeat.
What changes at the end is Shrek, not the world. He chooses to embrace his family and friends rather than lose his temper, and the story closes the series on Shrek valuing his ordinary family life. The It Is a Wonderful Life influence that Mike Mitchell has described is easy to see here: a man shown what his absence costs, who returns grateful for what he nearly lost.
It could be argued that the ending is the safest option available, because it resets everything to the party scene. Perhaps, but the hug is the payoff, and Donkey, Puss in Boots and the babies are all seen differently once the viewer has watched the darker version of Far Far Away. As for whether this was the end of the story, the film was positioned as the close of the saga, and Shrek 5 has a confirmed US release date of June 30, 2027, according to Variety.