Maybe a long time ago, but I get my pay which is supposed to be on the 1st and 15th on like the 13th and 29th or something. Getting paid "two days early" is a pretty common feature with Direct Deposit these days. It is always credited to my account before my actual paycheck technically gets posed.
> maybe charging a transaction fee
I imagine someone would be paying for the transaction of physically handling all the cash, no? Its not like having all the logistics of handling cash to potentially thousands of employees is a zero dollar cost. I imagine its massively cheaper for everyone to pay whatever marginal cost my employer is paying for ACH/DirectDeposit through their payroll app than paying a ton of people to handle and keep track of the cash.
My bank seems to trust my paycheck deposits, though, and they "clear" (update my balance and become spendable) under 24hrs after they show up as "pending."
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.