SSR renders HTML on each request so it can use per‑request data like auth and headers, but costs server time. SSG pre‑renders at build time and serves static files, making pages very fast and cacheable, but data is as fresh as your build or ISR revalidate window.
Expanding on the short answer — what usually matters in practice:
A tiny example (an explanation template):
// Example: discuss trade-offs for "ssr-vs-ssg?"
function explain() {
// Start from the core idea:
// SSR (Server-Side Rendering) generates HTML on each request. SSG (Static Site Generation) g
}