Structure is a better indicator of shared ancestry than function.
When species share the same structure despite not needing similar structures functionally, it shows that there was almost definitely a common ancestor.
A common example of homologous structures is the forelimbs of vertebrates, where the wings of bats, the arms of primates, the front flippers of whales and the forelegs of dogs and horses are all derived from the same ancestral tetrapod structure.