Believe it or not, but the purpose of a flower's pretty petals is to help the flower reproduce and make more flowers!
Have you ever learned about pollen? Pollen is a special yellowish powder-like substance found in flowers. (It makes some people sneeze!) Many flowers rely on critters like insects and butterflies to transfer their pollen from one to another, which is what makes it possible for the flowers to reproduce.
Having brightly colored and pretty petals is one of the ways flowers attract insects and butterflies towards themselves! The color of a flower's petals often helps it to appeal to the bugs or small birds that are most helpful to it, while the shape of the petals often serves the animal or insect's shape and size!
Have a grown-up help you look up your favorite flowers, and try to find out which kinds of insects, butterflies, birds, or other creatures are their most common pollen-spreaders! What about the flowers' petals do you think makes this insect and flower a good pair? For example, does the flower need a hummingbird's long, tube-shaped beak to reach inside of its special opening, or does it need a very small bee to fit between its many petals?