Both the encomienda and mita were forced labor systems with deep historical roots that underwent change during the Spanish Colonial era.
Prior to Spanish colonization, the mita system was established by the Incas so that all men between 15 and 50 years old worked for the government for two and half months a year. This ensured that each family had enough food for the year and enough time to complete their own endeavors. It was successful system in maintain the strength of the civilization and crucial to the growth of the infrastructure of the Incan Empire.
When Spanish Colonial rule was established the mita system was abused. The native peoples were forced to work in the gold and silver mines for months at a time. In addition, they were required to use their earnings to pay for living necessities which left them in perpetual debt while the Spanish Colonials forced Christianity upon them. The system, which was once beneficial, ended up enslaving the native Indians.
The encomienda system had its roots in the Reconquesta of Muslim Spain when the Jews and Muslims were forced to pay the Spanish conquerers. During the establishment of Spanish colonies in the Americas, the system was changed so the Spanish crown granted a specific number of indigenous people to important officials and conquistadors. The crown maintained ownership of the land while the native people were required to pay their owners in work or in gold. Again, this became a form of enslavement.
These systems were intended to spread Christianity throughout the Spanish colonies but both systems were abused and became forms of slavery. In the end, they did not meet their intended goals.