This is because many organisms have a common descent they may fit into this similar nested pattern, sharing anatomical and molecular characteristics. To this we call homology.
There is, on the other hand, another process called convergent evolution. This process is due to natural selection pressure that affects organisms in different ways according to its needs and environment. For example, when we consider a butterfly, a bat, or a sparrow, we may say that they all have wings, but those wings are not anatomically comparable because they have completely different recent origins.