Most scripting languages, including Lua, operate on a Virtual Machine (VM), which is basically a system to map a script instruction to a "real" CPU instruction or function call. The Lua VM normally runs in the same process as the main application. This is specially true for games that use it. The Lua API provides you with several functions that you call in the native application to load and compile script files. E.g. luaL_dofile() compiles the given script into Lua bytecode and then runs it. This bytecode will then be mapped by the VM running inside the API into native machine instructions and function calls.
The process of connecting a native language, such as C++, with a scripting language is called binding. In the Lua case, its API provides functions that help you expose native functions to the script code. So you can for example define a C++ function say_hello() and make this function callable from a Lua script. The Lua API also provides methods for creating variables and tables via C++ code that will be visible for the scripts when they are run. By combining these features you can expose entire C++ classes to Lua. The opposite is also possible, the Lua API allows the user to modify Lua variables and call Lua functions from the native C++ code.
Most if not all scripting languages provide APIs to facilite the binding of scriptingscript code with native code. Most are also compiled into bytecode and run in a VM, but some may be interpreted line-by-line.
Hope this helps clarifying some of your questions.
Bye.