I have been a banking programmer for some large European banks, so whilst I can't speak for the US system I can describe the way ATM transactions work in the UK, Germany & Switzerland.
Making a withdrawal from an ATM/ePOS does not debit your bank account immediately, but it does reduce the limit (i.e. available funds) on your card immediately. Checking your "balance" at an ATM shows the card's total available funds, not your bank account balance.
ATM operators are often not the same as your bank, even though they may show your bank's logo at the top. There are fees at every stage of the transaction so ATM operators and ePOS transaction acquirers can decide whether to ask your bank/VISA etc whether you have the funds. For small, low risk transactions they will often wait, preferring to batch a bunch of debits to a single institution at a quiet (cheaper) time of day.
Your card is reconciled with your bank account daily (usually daily). A payment to a third party takes longer - the payee's bank needs to complete reconciliation too and, as other commenters have pointed out, the network breaks sometimes.
Banks can improve the time it takes to transfer funds to third parties and have done so in many countries but it has taken government intervention. The float does play a part, but getting competing banks to agree to a standard is almost impossible.
Side note: Your card has many, many limits most of which you will never encounter. Examples: total cash per ATM per day; number of cardholder-not-present transactions per day; total spent in gambling establishments per month.