It is easier to understand about where living things live by looking at a small area for example near a rotting tree, or by a wall.
If you turn over a piece of rotting wood you are likely to spot woodlice, millipedes and worms, for example. But on top of the wood you may find ants and flies. Each needs its own special environment.