It harkens to the Shirley Jackson short story "The Lottery" but perhaps done better. The main character is highly dysfunctional in the real world, but she is a perfect fit for the cult created by the Midsommar folk. Thus her story embodies a fulfillment of a personal destiny.
Her decision at the end may have elements of revenge, but I viewed it as a realization that she was the only "new blood" that could make a life inside the commune, while also giving her a tabula rasa to erase any remains of her previous existence.