Avatara, people say, is a divine incarnation, and the purpose of that incarnation is believed to be threefold: to establish dharma, to eradicate that which is not dharma, and to bring happiness in the life of good people.
Now, each incarnation expresses certain qualities and attributes which are an inherent part of his nature, behaviour and mentality. These become the inspiration to establish dharma, righteousness, and nyaya, justice. It is also these qualities that define who becomes an avatara.
For example, in the Vaishnava tradition there are twenty-four avataras of Narayana, out of which ten are important. The ninth avatara in this group is Buddha. The eighth avatara was Krishna, the seventh was Rama, the sixth was Parashurama who was contemporary to Rama. It is not necessary that one avatara has to leave before the other can descend; two can coexist. Parashurama and Rama both lived in the same age and also had an encounter in the court of King Janaka, during the wedding of Sita with Rama.
Let us look at Buddha. People classify him as a non believer. He did not propogate any philosophy leading to God-realization; he only spoke of meditation and nirvana. Therefore the intellectuals of society consider him an atheist, and classify Buddhism as an atheistic philosophy. However this athiest was classified as the ninth avatara in the Vaishnava tradition. Why? Because he had one quality that permeated the entire globe: shanti, peace. They say that the personality and nature of Buddha was such that the moment you entered his presence, your mind stopped working and you experienced shoonyata: all the agitations, difficulties,stresses and worries disappeared. Kings would come and forget the affairs of the court, soldiers would come and forget their animosity, dacoits would come and be freed of their greed and violence. Everyone would experience the shoonya state.
That is identified as Nirvana: the state of shanti when there is no agitation, there is absolute peace and harmony. There are no spikes, ripples or waves, nothing; you are a static mirror reflecting everything passively and objectively. Due to this quality, Buddha became part of the assembly of avataras.
In fact, we are all avataras, for we are all part of the same element though separated from it, just as water in a cup taken from the ocean is only aware of the cup. If it was sentient, it would only be aware of the base and the walls, of the container it is in. The taste, quality and composition of the water in the cup are all the same as that of the ocean, but due to the awareness being contained in the container, it is only aware of that much. The moment the container is emptied, the water becomes part of the ocean; it again experiences the vastness, the omniscience, omnipotence and omnipresence of its own element. Those who are able to experience and express this are the avataras.