When it comes to the genre of folk horror, there is one that stands above them all and looms over 'Midsommar' as well.
We are, of course, talking about 1973's 'The Wicker Man' and while 'Midsommar' shares some stark parallels, the impact is different. To be clear, both movies feature a pagan cult and outsiders being brought into its ceremonies, either wittingly or unwittingly. They both end in human sacrifice, and the ritualistic destruction - by fire - of a holy place. They both have strong commentaries on normative sexual behaviour, and they both feature dancing and singing in broad daylight to violence.
Where 'The Wicker Man' had Sergeant Howie clinging to his faith - even as he's set on fire - 'Midsommar' has no such inclinations. Instead, what the ending of 'Midsommar' represents is not just the end of a relationship, but the beginning of a new life. Throughout the movie, there are references to how the festival is about rebirth and renewal. Sure, 'The Wicker Man' has that edge, but here, it's much more different. The harrowing cliff jump sequence is just the beginning, but also as well, the imagery surrounding the village all point towards rebirth and renewal.
When they first arrive in the village, for example, the elders greet the group as normal, but with Dani - Florence Pugh's character - they say "welcome home" straight to her face. You don't really catch it, and there's definitely a sense that nobody else in the scene catches it either, but it's there. Next, when Dani is taking part in the dance competition, she begins to speak Swedish when she's under the influence of the psychedelic tea. All of this, in a way, points to something else happening with Dani - that she herself might actually be reborn, and that she was destined to be the May Queen all along.
Leaving this aside, the other part of 'Midsommar' that it brings up is how break-ups - painful though they are - often bring about renewal in a person's life. Clearly, Christian - Jack Reynor's character - was a terrible partner, and had no interest in being in a relationship with Dani. That he betrayed her - even if he was tripping - he knew exactly what was going to happen. It's probably why, when watching the ending, there's no real sense of dismay in the character's deaths.
With the exception of Connie and Simon, the English couple who came with Ingemar, all of the characters have taken part in some kind of taboo. Will Poulter's character, Mark, urinated on the dead tree that housed the ashes of the village's ancestors. William Jackson Harper, who plays Josh, takes pictures of the village's sacred texts after he was explicitly told not to. Christian's taboo, however, isn't as obvious as these. Yet, when the final image sees Dani smiling as he burns, you get that his crimes are more personal in nature.
Throughout the movie, Dani is clearly in grief and has to swallow this in order to keep Christian from leaving him. He has no interest in trying to help her, and feels that he only has to stay with her because it's what's expected of him. Right before her parents and sister's death, Christian was planning to leave her. The use of the word 'affekts' is interesting, because it describes emotions. Christian's 'affekts' are being burnt, and the toxic effect he has had on Dani is going up in flames along with it. That's why Dani is smiling in the end. She's now free to begin again.
It shouldn't come as any surprise that Ari Aster was going through a breakup when he wrote the script for 'Midsommar', having being originally pitched the idea of a slasher-type movie set in Swedish pagan ritual. While he was initially reticent, the idea of a pagan ritual played into the idea of exploring a breakup. As he told Inverse, 'Midsommar' was "one of the most personal things I've ever written." That rituals in pagan festivals are so often concerned with renewal and the future, it makes sense to blend this with the ending where a relationship ends and the person moving on - albeit into another relationship.