Why a multi-stage build exists
You usually need a fat toolchain to build (compilers, build tools, dev dependencies) but a slim runtime to ship. Multi-stage builds give you both in one Dockerfile.
You declare multiple FROM stages. Each can use a different base image. COPY --from=<stage> pulls files from an earlier stage into a later one. Only the last stage becomes the final image.
The classic Node example
Stage 1 has Node + npm + your source + node_modules + a build tool that produces dist/. Stage 2 has only nginx + the dist/ folder. Final image: ~25MB. Single-stage equivalent: ~1.2GB.