A fern is a leafy, flowerless plant that grows in areas of high moisture. Ferns are vascular plants, in that they have a complex internal vein structure that supplies nutrients to the outer regions of the plant.
Ferns are different from other vascular plants in that most vascular plants grow directly from seeds, while a fern grows from a spore, through an intermediate stage called a gametophyte. A fern requires certain characteristics in its surroundings to grow. Moisture in the air and soil is a must. A fern is a fairly delicate plant, so wind protection is needed also.
A fern will require some direct sunlight, but not too much. Ferns also prefer climates that are more or less constant. A fern will usually not live through a frost. Ferns have even more specific conditions when it comes to reproducing. For example, a fern may live for a while in a fairly hostile environment, but will most likely not be able to reproduce there.
Ferns will only grow naturally where conditions suit the survival of both the plants themselves, and the intermediate gametophytes. It is commonly accepted that the strength of the gametophyte alone will determine survival of the fern. Ferns have evolved to suit their environment.
While some ferns are able to tolerate drought and heat, others will only thrive in the densest of rain forests. For a fern to grow properly in a garden, the garden and its surroundings must be very similar, nearly identical, to the environment it evolved in. For example, a tree fern, found mostly in rain forest climates, will not live in a garden that mimics a desert.
Below is a fern classification chart from Wikipedia: