First, ego and id go back to ancient Rome: Latin for “I” and “it.” Long before Freud, philosophers used ego to explore the concept of self. Freud gave them specific mental functions. Freud wrote in German, but we adopted the Latin versions to make them sound more academic — superego is a specifically Freudian term.
Sigmund Freud’s 1923 model of the mind has three interacting agents: the id, ego, and superego. There is some debate about how much agency he intended, but essentially the id represents our drives and immediate gratification. The ego mediates between those drives, the superego, and reality. The superego represents our internalized moral standards. To Freud, all three agents also operate subconsciously.
Now, my thoughts. Modern models align more with traditions before Freud. They reject his model but appreciate his focus on the subconscious. His focus on the subconscious helped pave the way for our modern ideas, but I think his focus on something akin to agents was too strong. I also find his conclusions about unconscious childhood desires to have sex with your mother and kill your father to be wildly wrong, strange, and really just an overgeneralization of his own self-analysis. Scientifically, he stepped way out over his skis.
I think what Freud called the ego is better explored through the self. In my writing, I focus on the ideas of non-self, illusion, and impermanence. I think the id is more about the mechanics of animal minds. The evolution of things like drives, instincts, and other automatic or semi-automatic processes. Finally, the superego is better explored through applied philosophy: how one ought to live. In my writing, that’s about your worldview and identity, including your internalized value system.