One source file becomes a larger translation unit

The preprocessor handles `#include` before the compiler checks C++ syntax and types. It reads the named file at that point and processes its contents as part of the current source file. If that file contains another `#include`, the process continues, so a short source file can expand into a much larger translation unit—the complete chunk of code compiled as one unit.

This is why a header can make names available without being compiled on its own. A header typically contains declarations, such as the description of a function, that let the compiler check how the source file uses it. The function’s compiled implementation may live elsewhere and be linked in later.

Textual inclusion has consequences

Because inclusion is textual, order matters. A macro defined before an included header can affect how that header is processed, and a macro in the header can affect code that follows. Including the same header more than once can also repeat declarations or definitions; include guards—preprocessor checks that skip a header after its first inclusion—prevent many such problems.

The same mechanism shapes build time. Each source file is generally preprocessed and compiled separately, so a widely used header may be read and processed again for many files. Changing it can require recompiling all the files that depend on it. C++ modules offer another way to share declarations, but traditional headers remain common, making the boundaries and contents of `#include` files part of how a project manages both compilation and dependencies.