How did Maryna Viazovska prove which sphere packing is densest in 8 dimensions?

The 2022 Fields Medal recognized Viazovska's 2016 breakthrough on sphere packing. Her proof showed that the E₈ lattice achieves a density no competing arrangement can exceed in eight dimensions. A team then proved the analogous result for 24 dimensions.
What does the packing problem measure?
Imagine placing identical balls so that their interiors never overlap. Packing density is the fraction of space they occupy when measured over increasingly large regions. In three dimensions, the best possible density is about 74.05%. Higher-dimensional balls cannot be pictured the same way, but mathematicians can define their distances and density just as precisely. The 8- and 24-dimensional percentages describe different spaces, so a smaller number does not make one proof weaker.
How do you prove that a packing is best?
An arrangement gives a density that can actually be reached. To prove optimality, a second argument must show that every possible arrangement is at or below that density. In 2016, Maryna Viazovska established such a matching bound for the E₈ lattice in eight dimensions, whose density is about 25.37%. Soon afterward, Henry Cohn, Abhinav Kumar, Stephen D. Miller, Danylo Radchenko and Viazovska extended the approach to the Leech lattice in 24 dimensions, at about 0.193%. Both proofs appeared in Annals of Mathematics in 2017. EPFL announced Viazovska's Fields Medal on July 5, 2022, recognizing the earlier mathematics.