(i) The moss is a bryophyte. Bryophytes lack vascular tissues for transporting water and food, and have only simple rhizoids instead of true roots. Water can move only a short distance through the plant body, so it cannot supply a tall plant; the moss stays a low mat (5 cm).
(ii) The fern is a pteridophyte. It has true roots, stems and leaves and vascular tissues: xylem carries water and phloem carries food throughout the plant. With this transport system, water and food reach all parts even of a tall plant, so the fern reaches 1.2 m, about 24 times the height of the moss.
(iii) Transport tissue solves the problem of size, but not of reproduction. Pteridophytes still need water for reproduction and do not produce seeds, so the fern can only grow where water is available, near the stream. The gulmohar is an angiosperm: it reproduces through flowers, its reproduction depends on pollination by different agents rather than on water, and its seeds are enclosed in fruits that help spread them to new locations. So it can also grow on the dry slopes.