The green plant you see is only half of its own life cycle
The trees, shrubs and flowers you see are just one of two generations. Botanists call this visible, double-chromosome phase the sporophyte; it alternates with a tiny single-set generation that, in flowering plants, has shrunk to a pollen grain and a small sac inside the flower. In mosses the roles are reversed.
Land plants and most multicellular algae live by alternating generations. A sporophyte grows from a fertilised egg, so each of its cells holds two sets of chromosomes, one from each parent. It makes spores through meiosis, the division that halves the chromosome count. Each spore grows into a gametophyte with a single set, which produces eggs or sperm by ordinary cell division. When those fuse, a new sporophyte begins. Meiosis in the sporophyte also offers a chance to repair DNA damage, including oxidative damage, in reproductive tissue.
Which generation dominates varies. In mosses, liverworts and hornworts, the green plant is the gametophyte, and the sporophyte stays attached to it, depending on it for food. Even so, the young sporophyte starts life nurtured inside the female organ, the archegonium, and because every land plant shares this habit of feeding its embryo, the whole group is called the embryophytes. In clubmosses, horsetails, ferns, gymnosperms and flowering plants alive today, the independent sporophyte is the main event. Most algae favour the gametophyte, and in some species the two generations look alike.
The sporophyte's rise set the stage for seeds. Early land plants made identical spores, but ancestors of the gymnosperms evolved two kinds: large, scarce female megaspores and small, numerous male microspores. In the Devonian, a number of separate plant lineages each arrived at the next step, endospory, in which the gametophyte develops in miniature inside the spore wall instead of breaking out as fern gametophytes still do.
In seed ferns, the female gametophyte stayed inside the parent's spore case, complete with egg-bearing organs. Windblown pre-pollen delivered swimming sperm, and the embryo began developing while still held within that structure. Heterospory and endospory were among the earliest steps toward the seeds of modern gymnosperms and flowering plants.
Source: Sporophyte