The classes have no hierarchy, an entity has multiple classes, and a class appears on multiple entities. They're merely tags. Those tags can be used in the code to restrict stuff (I.e. restrict females to attack soldiers), to apply bonuses (I.e. the attack bonuses) or any other use of filtering. So it's nice, when f.e. a technology states it affects military buildings, that you can see in the gui that a building is military. Otoh, some classes are really to broad (like you know what a unit is), and shouldn't be displayed. That's why there is a distinction between visible classes, and classes that are only to aid programmatic filtering, but are really clear to the user without putting it in the gui.