Survival is often about camouflage. Whichever species can hide the best from predators will live to reproduce.
Here, a snake is deciding what to have for lunch. The flamingo is a lot easier to find and catch because of its distinctive pink feathers, while the frog is small and blends into its surroundings. The snake decides that the flamingo would be an easier meal.
Because the frog blends in with the rocks and the ground, the snake doesn't go after it, and it is able to reproduce and pass on those camouflage genes.