They're based on notification from they payroll company about the incoming paycheck. They're not just assumed by the bank to be there, and I'm not charged any interest on it, so I wouldn't necessarily lump them into the same category as "payday loans" which usually carry extremely high interest rates and often don't actually have any basis on truly knowing if the paycheck is incoming or not. Getting paid early is not similar to going to a payday loan vendor and getting a loan.
So when my bank is crediting my account with my paycheck early, its because my work told them I'm getting paid that amount. Otherwise they wouldn't necessarily know of the amount. Sure, its like some kind of loan in a way, but its essentially paperovering the slowness of the ACH to actually clear in a decent timeframe.