It's a chicken and egg problem, no pun intended.
The change happened very gradually over millions of years. The answer to that question is similar to the Sorites paradox, or the paradox of the heap of sand.
If you have a heap of sand, and remove grains of sand one at a time, at which point does the heap stop being a heap?