The females need a way to tell the male they're ready to mate. When they are, their bright red bottoms swell, becoming very large and developing odd folds. Baboons spend a lot of time on the ground - more time than any other monkey. They walk on all fours, waving their tails, so it's easy for people and other baboons to see their rumps. People may find the swollen female rear ends ugly, but male baboons find them attractive.
Mandrills are a type of baboon.
Among them, it's the males who have the colorful rear ends, which match their equally colorful faces. Some scientists think they use their rumps to attract females. Ruling males often have the brightest colors. This may not only win them more females, but also discourage rival males. There are other theories about the male mandrill's colors.