This is an ancient term that was first used in Vedic texts some 3,000 years ago and was then used in Hindu philosophy, with it being particularly relevant in samkhya philosophy. It is one of the four different elements that make up the antahkarana (inner organ). The others are known as buddhi (intellect), manas (mind) and chitta (memory).
Lord Krishna said to Arjuna that it is necessary that ahamkara be removed, meaning that the ego must be eradicated in order to achieve true spiritual enlightenment. It is sometimes called "the instrument of the spirit" and can lead to undesirable feelings such as pride, jealousy and hate.