In evolutionary biology speak, this is called convergence: different types of creatures resembling each other because of similarities in lifestyle and environment. It’s why birds and bats, which both fly, each have wings. It’s why snakes and worms, which both squirm through underground burrows, are both long, skinny, and legless.