Since nobugz already covered your first question, let me expand on the second. It's not terribly difficult to understand.
When you compile a DLL in Windows, the linker creates an Export Address Table (EAT) that lists all the the exported functions (the functions the DLL provides) and a pointer to where they are implemented in the DLL itself.
When compiling a application that links to a DLL, the linker creates an Import Address Table (IAT) listing all the functions that are implemented in other DLL's and the name of the DLL that implements those functions. The way it knows that a function exists in a DLL is from the .lib file that you add to your project. That tells the linker that a function is implemented in a DLL.
Then at run time, while loading an application the Windows loader examines the IAT to see what DLL's need to be loaded, locates them, and updates the applications IAT (in memory) to point to the exported functions in the DLL's loaded.
That's the basics how it works, hopefully I didn't include any gross inaccuracies. And of course P/Invoke is another layer on top of this.
If you want more information on how DLL's work there is always the MSDN documentation and if you want enough detail to make you head spin read these Inside Windows articles Part 1 and Part 2