Where are the full site settings stored?

When you make modifications to templates the new HTML of the template is saved as a custom post type with the wp_template post type. This is then used instead of the version stored in the theme directory. The same is true template parts, except the post type for those is wp_template_part.

When you modify global styles the styles and settings properties of theme.json are copied to to the database, this time as a post with the wp_global_styles post type, with your changes applied to this copy.