This is how payday advances worked for most people before the age of complex payroll systems. You used to be able to ask your boss to get payed early for the time you had already worked. Now that is really hard because "the system isn't set up like that"
You can find out more by googling it.
Payday loans are much more akin to debt bondage, in that they are _often_ the start of a debt cycle that is extremely difficult to break.