It is said that for about 400 million years, termites have moved away from cockroaches. Sometime before that, plants were woody and termites were unique feeders on this new type of food. (Ants, around 300 million years ago their mortal enemy was recognizable).
Some termites specialized in humid, decaying wood, others in solid wood, and others in dried grass and leaf litter. Various nesting sites and types developed to match the ideal food and climatic conditions — mounds on the forest or grassland floor, mounds in tree branches, no mounds at all. Then there are dry wood termites; it’s just an accidental insect that doesn’t actually build a nest. They don’t even have contact with the ground because from a tropical climate they get enough moisture. Hundreds of genera, thousands of species, all of them specialized in their niche.
Check more details at https://www.termitespecialist.sg/