Themes as data, not code
In many platforms a theme is a folder of executable code. That is powerful, but every theme is also a security and performance risk.
The alternative
Here a theme is a small JSON document: colors, fonts, spacing and a few layout choices. Trusted components read those values and render the site.
Switching themes never breaks content, and a bad value simply falls back to the preset.