ESTAs used to be instant for me, but last time I got one (2023) it took 2 days
The US is particularly bad as you need an ESTA to transit. I had a friend nearly caught out by that on a flight from London to Lima which involved changing in Miami. When changing plane from an international to international flight in most countries you get off a plane, maybe go through security, and then get on another plane. In the US this isn't a thing. You have to immigrate into the country for 20 minutes.
The same rules in Canada and Mexico.