A species of tree mice live in the trees to avoid predators that come out at night on the ground. Eventaully, they overpopulate due to the lack of threats.
Survival of the Fittest
A mutation occurs in which a defect is found in the proteins, causing some of the mice to have shorter tails. This trait contrasts the long tail trait, but as of now, it has no impact, and is a neutral mutation.
An invasive species of snakes enters their environment. They're nocturnal, and see mice as easy prey.
Change in Gene Pool
The mice compete to survive against the snakes. The mice with long tails have a disadvantage, as they're able to be pulled by their tails out of the trees to eat. Those with short tails are out of reach. By natural selection, those with the long tail trait are eliminated.
Over time, those with the short tailed trait have a better fitness, which causes the species to adapt and those with the short tail trait go on to reproduce. This passes the genes for their trait onto their offspring.
In following generations, the species evolves to have mostly short tails. There are still some with the long tail trait, but they're scarce compared to their previous abundance.