In a certain species of fish, it had two different colors of fish within the species, white and light blue (about the color blue of the water they lived in) because their ancestors passed down dominant traits (light blue) and recessive traits (white).
When the fish were swimming through the ocean, a killer whale came along and was ready to attack.
Instead of having a feast on the fish, the killer whale only ate the white fish. The light blue fish were safe, but only because their light blue color was close enough to the color of the water that predators including the killer whale, could not see them as easily as the white fish, making the light blue color favorable for the fish and helping them survive.
After the close call with the killer whale and having the advantage of being able to not be seen easily by predators, which would allow for them to thrive in their environment, the light blue fish population needed to increase to ensure they would not go extinct, so, they reproduced.
They reproduced a lot! The light blue fish could only pass down the dominant light blue trait to their offspring resulting in only light blue fish.
The white fish population went completely extinct because of the killer whale leaving only a light blue fish population, which differed from how the species started out with a mix of both colors of fish.