This is an example of mutual exploitation or mutualism. Termites are social insects closely related to roaches. Termites have special communities of protozoans living in their guts that help them digest cellulose. One of the things that must happen when a termite egg develops is that it must obtain from others in the colony these specialized protozoans. In fact, every time a termite larva molts, it sheds the lining of its gut as well, and needs to get re-supplied with protozoans.
Adults excrete a special substance that contains the symbionts and feed it to the larvae.
The bacteria live in nodules in the plant roots. They fix the nitrogen, and release excess ammonia and nitrates into the nodule, where they are taken up by the legumes. In return the bacteria obtain nutrients from the plants. Brazil nuts grow in a capsule in the tops of the Brazil-nut tree. These trees are often 120 feet tall.