And it doesn't for the compiler in question either. As long as the headers exist in the places it looks for them. No compiler magically knows where the headers are if you haven't placed them in the right location
If you copy the clang binary to a random place in your filesystem, it will fail to compile programs that include standard headers.
Yes, that is the case for pretty much every compiler. I suppose you could build the headers into the binary, but nobody does that.