They're identical but countries pretend they're different. I got an evisa when I went to Indonesia and India. For each country, the process involved uploading a picture, filling in some basic details, and paying a fee. I was approved in 30 seconds for each. I'm pretty sure it was automatic.
ESTA is supposed to be a lower hurdle than a visa. But from what I've heard, approvals take longer and quite a few people get rejected.
Countries like to pretend they're still visa free, but honestly, it's just a pain in the ass and I'd rather they call it a visa. It's very, very easy to book a plane to a country, see all info indicating its visa free and you can just go, then right as you're about to head out, you decide to check for the 50th time just to be sure... and it turns out there's some "visa free process" for your country called EDtdjvubHHVJVF or some other random assortment of letters that involves a 2 hour application process and 24-72 hours (business days only) for approval results to come in. A visa would be preferable because it's more transparent.
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.
You don't need to visit an embassy for ESTA, for a Visa this in-person interview at the embassy is required.