When you run the compiler, one of the very first things it does is to scan all the DLLs in the plugins, plugins-licensed and plugins-user directories to get a list of all of the commands that are available - these are stored in memory, alongside the name of the DLL they came from.
As the compiler parses your DBPro code, it matches the commands you use against this list, so it knows which DLLs are used, and the entry points to the commands from those DLLs.
When the compiler writes the compiled code to disk, it writes out a table of the DLL names, and a cross-reference of entry-point names to DLLs.
When you execute your program, it uses the above lists to load the DLLs into memory, and get the entry-point addresses, then applies those addresses to the compiled code at the appropriate places.
There's a little more to it than that, but that's the basic method.