Evolution of leaves, from https://en.m.wikipedia.org/wiki/Evolutionary_history_of_plants
Plants were not the first photosynthesisers on land. Weathering rates suggest that organisms capable of photosynthesis were already living on the land 1,200 million years ago, and microbial fossils have been found in freshwater lake deposits from 1,000 million years ago, but the carbon isotope record suggests that they were too scarce to impact the atmospheric composition until around 850 million years ago. These organisms, although phylogenetically diverse, were probably small and simple.
The more familiar leaves, megaphylls, are thought to have originated four times independently, in the ferns, horsetails, progymnosperms and seed plants.
why did it take so long for leaves to evolve in the first place? Plants had been on the land for at least 50 million years before megaphylls became significant. However, small, rare mesophylls are known from the early Devonian genus Eophyllophyton – so development could not have been a barrier to their appearance. The best explanation so far incorporates observations that atmospheric CO2 was declining rapidly during this time – falling by around 90% during the Devonian. This required an increase in stomatal density by 100 times to maintain rates of photosynthesis. When stomata open to allow water to evaporate from leaves it has a cooling effect, resulting from the loss of latent heat of evaporation. It appears that the low stomatal density in the early Devonian meant that evaporation and evaporative cooling were limited, and that leaves would have overheated if they grew to any size. The stomatal density could not increase, as the primitive steles and limited root systems would not be able to supply water quickly enough to match the rate of transpiration. Clearly, leaves are not always beneficial, as illustrated by the frequent occurrence of secondary loss of leaves, famously exemplified by cacti and the “whisk fern” Psilotum.