The 12 IMAMS
The twelve Imams (a.s) were chosen by Allah (s.w) to help the Muslims remain on the right path after the death of the prophet. Ali ibn abi Talib (a.s) was the first Imam, and the remaining 11 Imams are all descendant of Prophet Mohammad (s.a.w) through his daughter Fatima al Zahra (a.s) and her husband Imam Ali (a.s).
Prophet Muhammad (s.a.w) informed the people there will be 12 vicegerents who will guide the Muslims after his death and that the first one will be Ali ibn Abi Talib (a.s). He also told them that the last Imam will bring justice and peace to the world.
After the death of the Prophet (s.a.w) some people who used to accompany him decided to go against his words and they took the leadership away from Imam Ali (a.s). They instead appointed other men and called them the new leaders of the Muslims. Those false leaders called themselves the "Caliphs" of the Muslims.
The 12 Imam's (a.s) lived first through the Ummayad dynasty and then the Abbasid dynasties (These dynasties were powerful families which kept on ruling the Muslims by force and then handing over the leadership to their children)
However most of these false leaders chosen by men and not Allah (s.w) caused disaster and corruption to spread. They also made life difficult for the descendants of Prophet Mohammad (s.a.w). However the Imams (a.s) continued to spread the message of Allah and helped the people understand and practise true Islam.
In Islam “infallible” refers to a person who does not commit any sin or make any mistake in worshipping Allah or teaching about Islam. Examples of infallible people are the Prophets, and the Ahlul bayt (a.s).
They are infallible because of their closeness to Allah (s.w). This proximity to Allah gave them the ability to see the true ugliness of sins and the true beauty of submitting to Him. Therefore they never committed a sin even though physically they could.