Those conditions don't exist anymore, so they're actually a non-renewable resource.
Oil is largely formed from algae.
Natural gas tends to be associated with oil deposits.
Anaerobic conditions are required for formation.
See Jeffrey S. Dukes, "Burning Buried Sunshine" (2003) <https://link.springer.com/article/10.1023/A:1026391317686> <https://dge.carnegiescience.edu/DGE/Dukes/Dukes_ClimChange1....> (PDF)
Instead solar did fine with a not-so-slow-but steady path.