Jeffrey Armstrong in his "Spiritual Teachings of the Avatar - Ancient Wisdom for a New World", Atria Books and Beyond Words, 2010, gives us a beautiful explanation to the word Avatar: Ava meaning to descend; tara to heal and restore. An avatar is born when the divine takes a conscious, intentional and purposeful reason to descent to the earth, taking on a physical body, to fulfill his mission according to the needs of the times, quite unlike a reincarnation that is a result of karma.
Sherab Chodzin Kohn writes in his book "The Awakened One - A life of the Buddha", Phoenix, London, 1994, the story of Buddha. Having taken countless lives, and having laboured and sacrificed for others in all those births, having practiced great virtues to prepare for buddhahood or enlightenment, he took birth as God in the Realm of Desire. He was teacher and king to thousands of gods. This life went on for thousands of years till the gods gathered around him one day and and told him that it was time for him to take birth on earth and gain enlightenment. He deliberated on it, whether it was the appropriate time, where and to whom he should be born, and finally agreed too that it was the ideal time for him to come down. Bidding farewell to the gods, he went to the Nandhana Groove in the Realm of Desire and mindfully died. The same instant he entered his mother's womb on earth. A Buddha was born.
A sadhu entered Ramaih Pillai's home when he was out. His wife invited the sadhu and served him as was the culture and tradition then. Jeffrey Armstrong writes that visiting guests should be treated with much love, respect and generosity for he or she might be the divine being. Before leaving the sadhu gave her the sacred ash and told her that the son she was to carry will teach the world the art of deathlessness. She conceived that very moment upon being bestowed the sambupaksha shrishti. She soon gave birth to a child who was named Ramalingam. As Swami Saravanananda writes in his "Saint Ramalingam", Ramalingam showed that contrary to common belief that the body had to be discarded to attain godhead, he made it possible to "lead illumined lives by retaining the body simultaneously". Swami wrote, "The divine light has descended from lofty heights into the human form in order to make him immortal."
Jeffrey Armstrong writes that when the yogi "gone bad" named Ravana appeared unstoppable, due to the immense grace he had accumulated out of his severe austerities, god then had a reason to descend as Sri Rama.
Sri Krishna came later for another purpose. And so it has been that each time there is an imbalance and a dire need for correction an Avatar appears.