Maat (1) or ma'at was the ancient Egyptian concept of truth, balance, order, law, morality, and justice. Maat was also personified as a goddess regulating the stars, seasons, and the actions of both mortals and the deities, who set the order of the universe from chaos at the moment of creation. Her masculine counterpart was Thoth and their attributes are the same. After the rise of Ra they were depicted together in the Solar Barque. (the sky deity who represents the Sun, or an aspect of it, usually by its perceived power and strength.)
Ma'at was reality, the solid grounding of reality that made the Sun rise, the stars shine, the river flood and mankind think. The universe itself, all the world around them, was sacred in the ancient view. "Ethics" is an issue of human will and human permission. It is a function of the human world of duality. What is "ethical" for one group is sin for another. But Ma'at, the reality that made all groups what they are is transcendent of ethics, just as a rock or a flower is amoral, a-ethical, without "truth or falsehood."
How can a flower be false or ethical? It just is!
How can the universe be ethical or moral, right or wrong? It simply is!
That is Ma'at.
Despite being a winged goddess she was judge at the Egyptian underworld at the Halls of Ma'ati. The dead person's heart was placed on a scale, balanced by Ma'at herself, or by the Feather of Ma'at (her symbol that she wore on her head was an ostrich feather). Thoth (god of writing and scribes) weighed the heart... if the deceased had been found to not have followed the concept of ma'at during his life (if he had lied or cheated or killed or done anything against ma'at) his heart was devoured by a demon (she was called Ammut - Devouress of the Dead) and he died the final death. If the heart weighed the same as Ma'at, the deceased was allowed to go on to the afterlife. (Thoth was the patron of scribes who is described as the one "who reveals Maat and reckons Maat; who loves Maat and gives Maat to the doer of Maat". In texts such as "the Instruction of Amenemope" (2) the scribe is urged to follow the precepts of Maat in his private life as well as his work.)
In life, it was the pharaohs' duty to uphold ma'at. "I have done Ma'at" has been spoken by several pharaohs, as well as being called "beloved of Ma'at." The underlying concepts of Taoism and Confucianism resemble Maat at times. Many of these concepts were codified into laws, and many of the concepts often were discussed by ancient Egyptian philosophers and officials who referred to the spiritual text known as "the Book of the Dead."
(1) Maat (Wikipedia)