The ego is a conceptual entity that identifies with the body. It's like the operating system of a computer. As long as the ego thinks it is the one and only, it is top dog.
When presence, or pure awareness makes itself known, the ego most often resists. However, at some point the ego may realize that it is futile to resist. It realizes that it is not the only one in town. Eventually it realizes that it is a fiction, and that pure awareness, God, source, whatever you call it, is the real master. Then there is a surrender. The ego remains, but it is no longer the top dog. Spirit or intuition takes on the greater role.