When you compile a source file (.cc), the compiler chugs through the [thousands and thousands of lines of] code that you've written and creates an object file (.o). If you include other source (.cc) files, then the compiler will chug through all of those as well, taking [a lot] longer to do so.
You want to be working in such a way that you compile only the code you're working on - why wait several hours for a compile to finish when the bit you're working on only takes a few seconds?
Obligatory XKCD Reference: Compiling
So; how do you "isolate" the bit you're working on to avoid all that unnecessary recompilation time?
Answer: You work in a "Modular" way, including only the definitions for any other bits of code you [re-]use. That way, the compiler sees only your code, plus those definitions; it never gets a look at the code (implementation) for the other bits.
Note: The Compiler doesn't care that it doesn't know about the implementation of those included functions. It only needs to know the "shape" of each function so that it can check your code against it. Threading all these prototypes, calls and implementations together is the Linker's job!
All that "definition" information is what goes in the "Header" files.
For example:
b.cc
int timesTwo(int in){
return in*2;
}
b.h
int timesTwo(int); /* This is a "function prototype" */
a.cc
#include <iostream>
#include "b.h"
int main(){
std::cout << timesTwo(5) << std::endl;
return 0;
}