Ancient Egyptian history is both complex and fascinating. There are several reason why Egyptian history is so complex. At first glance you will see that Ancient Egyptian history can be divided into eight different periods: the Archaic Period, the Old Kingdom, the First Intermediate Period, the Middle Kingdom, the Second Intermediate Period, the New Kingdom, the Third Intermediate Period, the Late Period, and the Ptolemaic and Roman Periods. Each of these periods is quite distinct in their politics, religion (though the basics were the same, allegiances to gods waxed and waned), and the people. The Intermediate Periods were times of great chaos, when the history of Egypt became even more complex since chaos tends to mean that records are inaccurate or missing.
When people think of ancient Egypt two things that generally come to mind are the pyramids and hieroglyphics. Therefore, the other major difficulty in studying Egypt is their written language. At least three written languages were used during the eight time periods of ancient Egyptian history: hieroglyphics, demotic, and Greek. Only Greek survived through history, but the Rosetta Stone allowed for the correlation between the three to be deciphered. Like most forms of writing, hieroglyphics originally began as pictures. The growth of cities and public administration created a need for record-keeping and accounting; the simplest way to record a transaction involved pictures. "Five cows," for instance, can be represented with five marks and a picture of a cow. But, as you can imagine, this type of writing is enormously inefficient (millions of pictures) and sometimes confusing ("Is that a cow or a hippo?" Five hippos?"). So the Egyptians developed a shorthand out of their pictures, in which a picture of a single-syllable word could stand for that syllable whenever it occurs in a word. Let me give you an example in English. Suppose we were to come up with a hieroglyphic system in English similar to Egyptian hieroglyphics. We have a single-syllable word, "cat," which we represent with a picture of a cat. So when we write the word, "catalog," we write the first syllable of the word with a picture of a cat. That's how hieroglyphics work. Simple, right? No. There is a twist. The Egyptians never indicated vowel sounds in their writing, so the picture of a cat actually stands for the syllable "ct." So the word "cut" would also be written by using a picture of a cat, and in the word "recite," the last syllable would also be a picture of a cat. But check this out: the word "react," since the last syllable consists only of the two consonants, "ct," would also be a picture of a cat.
You can see now how difficult it must have been to decipher this mess. Even the Egyptians had problems. For instance, in English the words "recite," "recut," and "react" would be spelled exactly the same way in hieroglyphics (if you spelled the words in English without vowels, the three words would be spelled "rct," "rct," "rct"). So the Egyptians would add a picture at the end of the word to identify the word; "recut," for instance, might be followed by a picture of a knife, "recite" might be followed by a picture of a mouth.
Because of this confusing way of writing, it is often difficult to know a great deal about Egyptian history. One of those problems is evident when you look at eunuchs in Ancient Egypt. Some historians suggest that eunuchs were unknown in Egypt and therefore, the Egyptian eunuch never existed. However, this is hard to believe since Egyptians were familiar with the three surgical modes of performing this operation: amputation of the penis alone, removal of the testicular apparatus, and total emasculation. The references to support this came either from the religious tradition, from the domain of fable, or from the subject of mutilation of cadavers for military or funerary purposes.
Horapollon lived in Egypt in the 5th century AD and is the author of the Hieroglyphica, one of the most curious works in Greco-Egyptian literature, arising out of the Hellenized atmosphere of Egypt at the end of antiquity. In this post-pharaonic work, Horapollon collects a series of hieroglyphic signs -- which by that time had become unintelligible even to educated Egyptians -- and attempts to establish for each of them the relationship between the image and its symbolic meaning. It is not until the Rosetta Stone was deciphered that these hieroglyphs could be read and understood. No matter how fantastical these attempts were in some cases, they are nonetheless of interest to Egyptologists, who do not fail to make use of them on occasion. Let us proceed like these specialists. Hieroglyphica contains an allusion to emasculation (castration) practiced on a living individual: "[How they portray a male who commits the crime of mutilating himself"]: "If they want to portray a male who commits the crime of mutilating himself, they draw a beaver: because the latter, when chased (by hunters), tears off its own testicles and leaves them behind as prey". Which leads us to think of sexual mutilation as a rite of self-castration.
Diodorus of Sicily also alluded, twice, to the existence in Egypt of castration practised on living beings. In describing the Theban monument which he called the tomb of Osymandias the contemporary of Augustus confirms that "on the second wall prisoners defeated by the king were represented deprived of their hands and sexual parts, as if to say that they were not shown to be men by their courage, and that they remained inactive in the midst of dangers". We can confirm that Diodorus never actually viewed a relief of that kind and that the description that he gives us -- no doubt based on second-hand information -- is based on an inaccurate interpretation of the well-known depiction of the calculation of the number of enemy cadavers by counting the phalluses and the hands. The composition in the Ramesseum is in ruins today, but fortunately one can find identical scenes elsewhere, notably at the temple of Ramses III in Medinet-Habu. Here one can see scribes taking the inventory of the cut hands and sectioned phalluses, piled up in heaps in front of the pharaoh. That these bloody trophies were in fact remains of cadavers and not amputations performed on living prisoners can be read even in the legends that comment on the reliefs, and even better in the following, more elaborate text of Meneptah, found at Karnak and not accompanied by any depiction. This inscription states that they are: "... killed persons from whom the phallus and prepuce has been removed ..." Later we find: "Killed Libyans from whom the phallus-and-prepuce have been removed ..."
Let us see if his second reference is more worthy of interest. This one cites castration as a corporal punishment provided by Egyptian legislators. His own words: "The laws concerning women were very severe. Anyone who was convicted of raping a free woman had to have his genitals cut off; because they considered that this crime included in itself three very great evils: insult, corruption of morals, and confusion of offspring." This is a special case of that policy of repression which, by attacking the part of the body with which the crime was committed, ensured that the guilty party "would carry unto death an indelible mark that must have prevented others from breaking the law, by warning of this punishment".
Obviously, the above castrations were done for a variety of reasons. Self-castration was probably performed as part of a religious cult for one of the Egyptian gods. It was also not uncommon in ancient warfare to castrate or otherwise mutilate prisoners of war. The reason for this is to either make the soldiers lame so that they could no longer fight or in the case of castration to keep soldiers from producing future generations of soldiers that could wage war. The third instance, as a punishment for rape, is somewhat self explanatory from above. Often these men castrated as punishment would have become slaves.
However, it appears that eunuchs, like eunuchs in other areas of the ancient Middle East, performed bureaucratic duties or as men who guarded harems. Why it was necessary to castrate government bureaucrats, may never be known but if you have ever had to deal with bureaucracy, you might understand the desire to castrate bureaucrats, LOL.