"only" is doing a lot of work here, current lithium batteries are under 1 MJ/kg while good ol car gasoline is at 40+ MJ/kg
top fuel dragsters run nitromethane which is 4 times less energy dense than regular gas yet the go much faster so clearly there is much more going on than just energy density, like the fact that they have to entirely rebuild their engine every other day. I don't even think energy density is a big deal, it's more about how fast you can convert it into movement, and explosions are very good at that type of large scale conversion