On windows there are two kinds of .lib files: static libraries and import libraries.
A static library .lib contains a collection of .obj files. It's code that was compiled but not yet linked.
An import library is a .lib that works with a matching .dll. The .lib contains linking information (used at link time), while the .dll contains all the actual compiled code (used at run time).
When you run a program that was linked with an import library, it will automatically search the path for the .dll file and load it for you. This means you can replace a dll with an updated version without recompiling the main program.
It's also possible to manually load a dll and connect to it's functions without using a .lib, which is how plugin systems often work. It's less convenient though, needs way more manual code.
So yep, you are right, .libs are used when linking to prepare the executable for future use of the dll.