They are not a 'moss' despite their name in the fish aquarium industry. They are a slow-growing form of algae.
As any plant, they consume ammonia (or nitrite or nitrate, in that order) to grow, provided they have the other things they need (a source of carbon, other nutrients such as potassium and phospate, and sufficient light). In exchange, they provide some oxygen during the photoperiod, but consume it in darkness.
In my experience, they do best in medium-high light and lots of water movement. They collect debris in the tank and must be regularly cleaned off (either by you or smaller fish/shrimp/snails). When I had them, I would swish them around in the water I was removing during a water change, much as you would for filter media.