The fern life cycle and moss life cycle are similar in that they have alternation between sporophyte and gametophyte stages and that both rely on layers of water so that their sperm can swim from one gametophyte to the eggs of another. This means that both ferns and mosses require relatively moist environments. They are also similar in that their gametophyte stage, unlike other plants, does not rely on sporophytes.
Mosses and ferns are the first and second oldest types of land plants, respectively. Mosses lack any sort of vascular system, and so rely purely on diffusion to distribute water through them. This greatly restricts their size. The easily visible parts of mosses are the gametophytes, which create gametes. When a sperm joins with an egg in the gametophyte, a sporophyte is formed, attached to and dependent on the gametophyte. The sporophyte, in turn, distributes spores which grow into gametophytes.
In ferns, this relationship is somewhat reversed. Fern sporophytes are much larger than the tiny gametophytes, in part because unlike fern gametophytes and mosses, they are vascularized. This allows a much more efficient transport of water. However, the relationship is not a perfect reversal, as the gametophyte lives independent of the sporophyte. When the egg in a gametophyte joins with a sperm, a sporophyte grows from the site of the gametophyte.