Anatomical and molecular features often fit a similar pattern due to Homology. Homology is the existence of shared ancestry between two structures or genes in a different species.
A process that can cause this not to be the case is Convergent Evolution.
Convergent Evolution occurs when two unrelated species independently evolve similar traits to cope with evolutionary changes.