The Pantheon is the best-preserved building of ancient Rome, and the reason is not that anyone valued it as architecture.
Every other major temple in Rome was quarried. Marble was burned for lime, bronze was melted, and columns were carried off for new churches. The Pantheon escaped because in 609 the emperor Phocas gave it to Pope Boniface IV, who consecrated it as Santa Maria ad Martyres. A building in continuous use as a church is maintained, roofed and defended. That is the whole explanation.
It was not left entirely alone. Urban VIII, a Barberini pope, had the bronze stripped from the portico ceiling in the 1620s and reused, prompting the Roman line that what the barbarians did not do, the Barberini did.
The engineering. The dome remains, after nineteen centuries, the largest unreinforced concrete dome ever built: about 43 metres across, the same as the height from floor to oculus, so a sphere would sit exactly within the interior. It works through a graded structure that is genuinely ingenious: the walls are 6 metres thick at the base and the dome thins to about 1.2 metres at the crown; the coffers cut weight while stiffening the shell; and the aggregate itself changes with height, from heavy travertine near the base through brick and tufa to light pumice at the top. The oculus, nearly 9 metres across, is open to the sky, and the floor beneath it is slightly convex with drain holes to take the rain.
Two things are less certain than commonly stated. The inscription across the portico names Agrippa, who built the original around 27-25 BC, but the standing building is Hadrian's, of the early second century, which retained the older text, a fact that misled visitors for centuries and that raises an unresolved question about why Hadrian did it, since he generally did not sign his buildings. And what it was dedicated to is not known. The name means all the gods; whether that was a formal dedication, a nickname, or a reference to a specific group of deities is disputed.
It remains a functioning Catholic church and mass is celebrated in it, while also charging tourist admission since 2023. Modern Roman polytheist groups, who reconstruct the civic religion from texts and inscriptions and are generally explicit that theirs is a reconstruction rather than an unbroken descent, have sought access to hold rites there, mostly without success.