Mosses and ferns are found in moist and shady places because both :
depend for their nutrition on micro-organisms which can survive only at low temperature
do not need sunlight for photosynthesis
require presence of water for fertilization
cannot compete with sun-loving plants