Magic has been a fundamental part of humanity's development. It has existed since it's begining, and has been an essential part of its dominant religion which plays a role in the lives of millions around the world. Magic is seen as a gift from the gods, a way to secure humanity's future and a symbol of its dominance and mastery over the world. It is slow, complex, and ritualized, but has powerful effects.
Unfortunately, due to events in an ancient war thousands of years ago, men have lost their ability to perform magic. The reason for this has been forgotten by history, but the effects have been felt by all males currently. Whether it was given up as a noble sacrifice to stop a coming apocalypse, or taken from them as a punishment for some crime by god, or robbed by some curse against their will, continues to be debated by historians. Nevertheless, women have taken over the roles played by priests and church officials.
the idea that men cannot be trusted with magic has heavily weighed on the development of cultural traditions and normative gender roles in the world. even with some societies advancing and rejecting some of these notions, reversing the cultural momentum has been difficult. The religion teaches that men and women are equal in the eyes of god. However, Since the sins of the father are visited upon the son, all men share this debilitating factor with magic and are seen as "lesser" in the eyes of their diety.
There is one way around this no magic rule. In order to access the lost ability to access magic, men must go through a process that ultimately ends with them proving themselves worthy and being accepted into the church hierarchy. The process is long and grueling, and some do not survive to the end. The ones who do go through painful ritual scarring during the initiation ceremony which involves being castrated. the ceremony is where they enter into a pact with the diety. This is meant to symbolize their purity and devotion to god's will. These "eunichs" are some of the most powerful males in the world. They are represented as a third sex, taking aspects from both men and women and becoming a distinct gender altogether.