A terrarium is an area within a glass container usually enclosed to keep an ecosystem in a small scale. No live animals or insect are kept in the jar, it's purely a miniature garden. Within the closed transparent environment, sunlight is still able to penetrate the vegetation causing the water vapors to rise, the vapor is trapped on the roof and drops at night as temperature cools creating a cycle of water. The cycle allows for life to flourish creating a self sustained eco-system.
There are generally two types of terrariums, closed or open.
Closed terrarium are generally for more tropical plants such as Moss, Orchids, Air Plants - moist & shade loving plants. Keeping the glass closed allows moisture to be trapped, but you must open it at least once a week to dry it out. The idea that you can close them forever is a myth, because mold will form and could destroy the eco-system.
Open terrariums are more for dry plants, such as succulents. Not all plants want so much moisture so for dry plants, open terrariums use an open glass to keep the air dry.
The first terrarium was developed by a botanist called Nathaniel Bagshaw Ward in 1842. Nathaniel had interest in observing insect behaviour and accidentally left one of the jars unattended. A fern seed grew, germinated into a plant, and the terrarium was born. The trend quickly spread in the Victorian Era amongst the English. Instead of the terrarium, it was known as the Wardian Case.