There is nothing special about petrochemical energy when it comes to growing food. We could run the agricultural system on other energy sources. In the US, the total fraction of energy used for agriculture is about 1%. We use more energy cooking food than growing it.
Hydrocarbons contain massive quantities of easily liberated energy and large quantities of easily liberated hydrogen.
Which are then easily and economically converted to ammonia to power the largest single form of fertilizer used in the world - nitrogen fertilizer, in the form of ammonium nitrate and equivalents. [https://en.m.wikipedia.org/wiki/Haber_process]
10’s of millions of tons/year are produced right now.
That process alone is responsible for likely at least 50% of the human population increase since it was invented, literally billions of people.
It is much harder to get there with any other form of energy, albeit not impossible.