@abenomics12345
I've just thought of a better way to explain this, although it does require high school level chemistry and physics
With hydrogen/ammonia, you're essentially manipulating atoms. So you're splitting up water into the component hydrogen and oxygen atoms or trying to combine hydrogen and nitrogen into ammonia. Then you're compressing, storing and transporting. Then adding oxygen to burn the end product to generate heat in an engine.
The atoms you are working with are by definition pretty stable, so it takes a lot of energy to get them to combine or split up.
Everything described is essentially a mechanical process which doesn't have a lot of room for improvement
---
In comparison, electricity works with the electrons that orbit around every type of atom found on the periodic table.
These atoms orbit at 2200km per second and it is relatively easy to knock electrons away from their orbit and therefore cause electrons to move to another atom, which is the basis of electricity.
Photons of light can do this in solar panels. Other wavelengths such as UV, Infrared and Radio Waves do this as well.
Then there are different way to organise how the electrons move back-and-forth in a battery, and therefore what the electromagnetic flux (fields) look like and how it transfers energy.
So you've got:
1. 100+ elements on the periodic table and you can have any combination you want. Some will be better but others worse. Each has an associated cost and other attributes.
2. That is combined with a huge number of battery/solar/engine designs and optimisations available. Again, each has costs, advantages and disadvantages
The available permutations are so large that Tesla for example uses a ML algorithm to run millions (billions?/trillions?) of permutations to figure out what is the optimal battery design for a set of criteria or constraints.
---
So that is the fundamental physics/chemistry basis of why solar and batteries have a higher rate of improvement.
Plus solar/batteries have advantages in terms of scale and also in R&D development.