Evolution predicts that the designs of species are often influenced as much by history as much as by need. When we see similar structures in cousin species it is because they inherited the design from a common ancestor. That particular design was probably not the best for each of the different species, but it was available.
On the other hand, when we see similar structures in more distant species it is because the design was needed. The design just happened to arise in the different lineages, and was selected because it helped. Given these two general explanatory mechanisms evolution can explain a wide variety of patterns. But not all. Sometimes cousin species have differences that are too pronounced. And likewise, sometimes distant species have similarities that are too pronounced.
Or sometimes the patterns are so jumbled they simply defy evolution's expectations. Consider, for example, the behavior of communal egg laying. This behavior, where neighbors pool their eggs in a common nest, is widespread among animals including mammals, birds, amphibians, reptiles and insects. And although widespread, the pattern is complex. In any pair of cousin species, the behavior of communal egg laying may or may not be conserved.
The figure above, for instance, shows an evolutionary tree representation of different lizard families. The indicated families contain communal egg laying species. Evolutionists must imagine that communal egg laying evolved over, and over, and over, for different reasons in very different species in a wide range environments. But yet in cousin species it evolved in the one but not the other.
Of course evolution doesn't think twice about such quandaries. The right mutations, whatever they were, came along, over, and over, and over without causing a mutational overload to produce a never ending stream of communal egg laying experiments. So not only does evolution explain similarities between both neighboring and distant species, it also explains everything in between.