Reality is a much trickier concept than most people realize. It is also much more of a value judgment than almost everyone realizes. We declare to ourselves what is real or not. Yet, what is real or not is independent of our thinking and judging.
Maturity is when you recognize that what is real for us and what is real independent of us are two different things. “Ego” is that part of us that resists that realization. “Ego” is not illusion, it is a real part of us that our thinking can fall into. What we could call “not real” or “illusion” is the idea that “ego,” or in other words, our desires, dictate what is real beyond ourselves. There is nothing wrong with desires; what is error is forgetting that our desires are not all that is. That forgetting is falling into “ego.”
“Attachment” does not mean the same as desire or want. In Indian philosophy and spirituality, it means a bondage to something else. It is akin to an addiction. A mistake so many make is assuming avoiding attachment means avoid all connections and desires, when it instead means only to avoid dependency on (bondage to) something.
I don’t see Buddhism as adding much of value to that understanding of who we are and how we relate to the world. It tells us to go in the opposite direction — away from accepting who we are and the need to connect with the world.