Petrol (gasoline) has around 50 times the watt/hour capacity of a lithium ion battery, by weight.
However, to be pedantic, this is not energy density.
Energy density is volumetric. With aircraft, we're more concerned with weight, which is termed specific energy.
Internal combustion engines at best convert 20% of their fuel energy to power. (I don't believe the 33% figure from a Piper quoted above, that defies physics.)
Whereas an electric drive can achieve over 90%.
This brings the specific energy "output" comparison down close to a factor of 10 rather than 50.
Lithium batteries are improving rapidly. Gasoline isn't, and neither are ICE's. So the gap can only narrow in time.
Also, other battery technologies are in the wings that could significantly improve upon Lithium in the coming decades.