sphagnum moss is commonly used as a lining for baskets and pot plants, however many Terrarium builders use sphagnum moss as a drainage layer between the soil and other elements. This creates a barriers so all parts are seperated from each other and remain that way.
Sphagnum moss is the "sponge layer" in the terrarium that soaks up and helps retain water.
"Using sphagnum instead of a mesh is a great organic alternative. The sphagnum moss works as a sponge and stores up the excess water draining through the plants, moss and soil above. When the soil dries out it will drink this water back up" - Highland Moss