How SSG works
During a build, the framework pulls content from files or a headless CMS, runs it through page templates and writes out HTML, CSS and small amounts of JavaScript. Those files are uploaded to a CDN. When someone visits, the nearest server returns a ready-made file with no database query or rendering step.
Many frameworks also support incremental regeneration, where individual pages rebuild on a schedule or when content changes, without rebuilding the whole site. That removes the old drawback of slow full rebuilds on large sites.
SSG has existed for decades in simple forms. What changed is that modern frameworks let static and dynamic pages live in the same project, so you no longer pick one approach for the whole site.