Homology refers to when two or more things have the same evolutionary origin, position or structure. Homology is important in comparative biology, allowing scientists to understand the function of body structures and make evolutionary connections. In particular, scientists study examples of homologous organs and structures.
Homology is an overarching concept, including both homoplasy, when an organ or structure is similar between beings because they share an evolutionary origin, and analogy, when organs or structures resemble one another because of shared function and/or position. Studying several examples of homology will better illustrate this relationship.
The forelimbs of a frog, a bird, a rabbit and a lizard look very different because they have evolved differently in response to the evolutionary pressures on each animal. However, they share a common ancestor, and thus also share a common set of bones: radius, ulna, and humerus.
Those bones date back to the first prehistoric fish to emerge onto land. Human arms and even bat wings share the same basic skeletal structure. This is an example of homoplasy, in which structures are similar because they share an evolutionary origin.
The leaves of a pitcher plant, a Venus fly trap, a cactus and a poinsettia are all examples of homology. The common structure is the bract, a specialized leaf that evolutionary pressures formed into everything from the traps of predatory plants like pitcher plants and flytraps to edible nopales to the brightly colored "flowers" of the poinsettia.
This is an example of analogy, rather than homoplasy: the plants in question are not closely related, but each has thickened and developed leaves into bracts to serve various evolutionary functions.
Insect mouthparts are a perfect example of homology, because their evolution is diverse enough to include both homoplastic structures and analogous ones. For instance, it is common for scientists to divide insects into "biting insects" and "sucking insects." Within both groups, there are homoplastic clades derived from a shared ancestor.
The stag beetle family, for example (Lucanidae), contains more than 1,200 homoplastic species. They take their shared name from the large, antler-like biting mouthparts stag beetles received from their common ancestor. That is an example of homoplastic homology.
By contrast, consider lice (Phthiraptera). Common sense might put lice in the "sucking insect" category, since they're infamous for sucking blood. That reputation is well-earned; every single one of the more than 5,000 species of louse feeds on animal (including human!) blood. However, they are properly speaking biting insects, not sucking insects.
They have simply evolved unique piercing mouthparts that closely resemble--and do the same job as--the mouthparts of mosquitoes and other blood-drinking "sucking insects." That is analogous homology.
Despite their similarity of shape, there is no evolutionary, or homoplastic, link between worms and snakes. Instead, snakes are a textbook example of analogy in evolution. The fossil records suggest that snakes descend from burrowing lizards. In fact, many snakes have vestigial or internal remnants of rear legs.
While it was once widely believed that snakes were a basal form of reptile, close to the earliest forms of reptile in history, the current consensus is that snakes evolved quite recently. In particular, they evolved to burrow, and so eventually became smooth-scaled, developed eye coverings to avoid injury while digging, and ultimately lost their limbs, leaving them with a body plan more closely resembling that of a worm or an eel than a Komodo dragon. In fact, snakes are more closely related to the latter; they just have traits analogous to the former.
It is the nature of the origin of species that nothing is unique. Virtually every organism has at least a few homologous structures, whether by evolutionary homoplasy or simple analogy. For more biological insights (did you know bacteria are such masters of evolution that they can eat artificial fabrics?) explore our examples of evolution and examples of genetic drift.