You're thinking of coal. There was a 60 million year period between the evolution of lignin (the key ingredient of wood, which allows plants to grow very tall) and the evolution of fungi which could break it down - so dead wood just stacked up, higher and higher. We call that period the Carboniferous, and almost all coal comes from then.