Lua's debug library is not a debugger. Rather, it is all the building blocks needed to implement a debugger. One thing to remember when writing code against the debug library is it's going to be slow. On top of running your existing code, some extra work has to be done to enable debugging. All code related to the debug library is found in the debug table (module).
The debug library provides hooks and introspective functions. Hooks let you hook into the runtime to trace what's happening with the program. Introspective functions, on the other hand, let you inspect various aspects of the running code. These aspects involve local variables, the scope of chunks, and so on.