This is a myth that sets unusual talent against dharma (the moral order), in this case the duty of accepting the restrictions of one’s caste. The master (acarya) Drona was a brahmin who refused to teach one who was not twice-born. Drona taught the Pandavas and the Kauravas to be great archers, but unknowingly he prepared them to fight each other in the great Bharata war.
Dronacharya had not accepted Ekalavya as his disciple because he belonged to a lower caste. Ekalavya made an idol of Drona, worshipped it, and started learning the lessons of the great sage without his knowledge. Arjuna learned that Ekalavya was as skillful as he in archery. He went to Drona and asked how could this have happened, when Drona had already announced that Arjuna was the best in archery. Ekalavya was questioned and confessed that he had learned the lessons without Drona’s knowledge. Drona accepted Ekalavya as his disciple. Then Drona asked for guru-dakshina, the token payment given to the teacher. Drona asked for Ekalavya’s right thumb, which he cut off and gave to the guru.
This is a cruel myth, illustrating that one must follow one’s own dharma (svadharma) rather than someone else’s. It taught a very rigid application of the Brahmanism of the law books (the Dharma Sastras and Dharma Sutras): one’s life was already defined by birth and stage of life (varna-asrama-dharma). As a student, Ekalavya had to obey his teacher. And without his right thumb, he no longer could strive to become a warrior (ksatriya).