The compiler would normally give an error finding that you're using cin without having, at least, declaring it.
With extern, you can tell the compiler "easy, easy, trust me, there is somewhere else a declaration and a definition for a cin of class istream.
Then the linker jumps into action, and the link between the call to the uses of cin and the object itself are specially "pending". The linker has to unite all these calls with their destination, and now is when the fact of cin existing or not (has been compiled or not) has its importance. If not, then the linker fails. The errors provided by the linker are far more cryptic than the ones given by the compiler, but they are interesting to explore, because are a very good way to learn.
For example, the following piece of code does not #include cstdio not stdio.h, but we know that printf will be there, because the standard library is always linked with our program. Yes, it works.
extern int printf(const char *, ...);
int main()
{
printf( "Hello, world!\n" );
}