Evidence of evolution
Homologous features are inherited from a common ancestor, even when functions differ. Analogous similarities can evolve independently under similar selection pressures. DNA and protein comparisons provide evidence about relatedness; comparisons across many independent loci are stronger than an isolated superficial resemblance. Transitional fossils document combinations of features through time rather than a ladder toward perfection. Endosymbiosis is supported by several bacterial-like features of mitochondria and chloroplasts.
Bat forelimb bones and whale forelimb bones share an inherited structural pattern despite different functions. Wings as flight surfaces in birds and insects evolved independently.
A similar function does not prove close ancestry. Evolution can arrive at comparable solutions in separate lineages.