The vast majority of money is created by commercial banks. They are, largely, free to do so to whatever degree they deem fit, and the central bank adjusts reserves to match. Almost all money is debt, created by extending loans in this fashion. The textbooks are for the most part wrong. The money multiplier / fractional reserve banking / etc. information is completely wrong.
I find fascinating that, despite the simplicity of the question, not every economist agrees on how this happens.