The peacocks with the showier feathers are able to attract mates, so they are the ones that have offspring, and pass on the fancy-feather genes to the next generation. However, the organism must also be able to survive. Peacocks can fold up their tails, which lessens the danger of being noticed by predators or getting caught in the bushes. In addition, as with most species where the males are colorful or fancy to attract the females, the peahens are much duller and more camouflaged, in a large part because they are the ones who guard the eggs and chicks. Survival of the next generation is very important.
Many plants have flowers that are pretty and brightly colored.
This is because the brightest colors attract bees, butterflies, and other pollinators, which enable the plant to reproduce. If a flower is dully colored, it does not reproduce, and the dull color genes dissappear from the population, whereas the plants with brightly colored flowers reproduce, so they gradually make up more and more of the population.