There is the knowledge of the One and the knowledge of the Many. “If the mind (manisi) absorbs itself in God as the formal becoming (paribhu) and separates itself from God in the true Idea (kavi), then it loses Vidya, the knowledge of the One, and has only the knowledge of the Many which becomes no longer knowledge at all but ignorance, Avidya” which causes the sense of separate egosense.
Avidya is required to develop individual relations, which when illuminated will reveal the One in all. “This is our proper course and not either to devote ourselves exclusively to the life of Avidya or to reject it entirely for motionless absorption in the One.” “The ego created by Avidya is a necessary mechanism for affirming individuality in the universal as a starting-point for this supreme achievement.”
So according to the Upanishads, seeing difference, where there is none, is avidya. It is also the cause for ahamkara. When avidya is dispelled ahamkara also vanishes.