I've been a PayPal user for 20 years. It used to be that cash transfers from you bank account into PayPal were instant. This made sense because ACH transfers are instant. But nowadays, the ACH transfer takes place immediately but PayPal holds onto the cash for two weeks before releasing it into your account.
Doing this with checks is a crime called check kiting. This allows the recipient to make use of the time-value of money for free, without paying interest. But it's legal in this setting simply because there's no law against it.