TLDR Imamat History: Arabia
On his last pilgrimage, the Prophet Muhammad appointed his cousin/son-in-law/BFF/roommate Aly, son of Abu Talib, as his successor. However, after the prophet's death, his adviser Abu Bakr was appointed the Caliph of the Muslims and he kept Aly as a consultant, as did his successor Umar. Then after his successor (Uthman) was killed, Aly became the Caliph of (most of) the Muslim community. He faced opposition from Talhah and Zubayr (Muhammad's friends) and Aysha, all three of whom were defeated in the Battle of the Camel. He was also apposed by Muawia (Uthman's friend) who he fought in Siffin, but they apprehensively tried to broker peace. Some of Aly's men didn't like that he tried to settle non-violently, so they (known as Khwarij, this is important later) fought Aly and lost in the battle of Naherwan. Muawia (who called himself the Caliph and had a super-strong Syrian army by this point) challenged Aly again, but Aly was killed in the Kufa Mosque before he could go to battle.
Hassan succeeded to leadership after Aly, and proceeded to fight Muawia with the 40,000 troops Aly had gathered. Muawia played dirty, bribing Hassan's uncle Ibn Abbas and trying to bribe commander Qays bin Saad. He also spread rumors that Hassan had surrendered, prompting a mutiny. Ironically, that forced Hassan to actually surrender, with the agreement that Muawia didn't make his son, Yazid, the Caliph after him. Hassan retired in Medina, but Muawia repeatedly tried to poison him. Eventually he succeeded, with Hassan's wife, Asma, doing the deed. He'd promised Asma could marry Yazid, but of course didn't follow through.
Although Hassan isn't considered an Imam by Ismailis, he is by many other Shia groups. Also, he's important to the story.
Husayn continued Hassan's agreement with Muawia and didn't proclaim himself Caliph, that is until Muawia tried to break the agreement and appoint Yazid Caliph. Husayn didn't swear allegiance to Yazid and gained a lot of support from the Muslim provinces, because no one really like Yazid. He also married Sherbanu, daughter of the Persian Emperor Yazdegird, as a gift from Umar's Persian conquest. Husayn got a diplomatic invitation to Kufa, but sent his cousin Muslim bin Aqil as a precaution. Everyone in Kufa treated bin Aqil super nice in order to lure Husayn there, and it worked. Husayn reached Karbala (across the River Euphrates from Kufa) and was surrounded by Yazid's army, lead by Umar bin Saad. The army prevented Husayn's caravan from approaching the river, or from retreating back to Medina, essentially starving them in their camp. During the ensuing battle, both sides lost 88 men; Husayn was killed on the 10th of Muharram, as was most of this family (it is still a day/month of mourning for Shia Muslims). A man known as Shimar delivered the final blow, cut off Husayn's head, and delivered it to Kufa and then Damascus, to Yazid. This act angered even Yazid's followers, so he allowed Husayn's surviving family and followers to return to Medina.
Imam Zain alAbidin
Only four of Husayn's children survived Karbala: two daughters and two sons. Aly Asghar (later known as Zain alAbidin) was very sick and wasn't allowed to fight in the battle. Back in Medina, Zain alAbidin opted to live a peaceful life, devoting his time to prayer and reorganizing the Shia after the battle of Karbala, even though the surrounding Muslim Empire and Umayyad Dynasty went through a period of rapid change. He also married his cousin, the daughter of Imam Hassan, reuniting the family lines.
Imam Muhammad alBaqir
Muhammad alBaqir continued the quiet reorganization of his father, Zain alAbidin, while trying not to upset the surrounding Umayyads. But his brother Zayd had the exact opposite idea: he revolted against the Umayyads, claimed Imamat and Caliphate, united Arabs with Persians and Iraqis under the promise of an easy life with low taxes, and established law based on the Quran. He was promptly killed by the Umayyads. Muhammad alBaqir, with the help of Abdul Khattab and Maymun alQaddah focused on opposing the Umayyads ideologically, instead of physically. They unified Shia philosophy and established the Mission (Dawa), which promoted the ideas of Divine Light, Imami infallibility, the difference between the Speaking and Silent Qurans, and the interaction of their apparent (zahiri) and hidden (batini) meanings.
Imam Jafar asSadiq
Following in the footsteps of his father and grandfather, Jafar asSadiq spent his time studying the Quran and the Hadiths. His teachings formed the basis for not only Shia law, but also for certain schools of Sunni law. His work even inspired the Brotherhood of Purity. Jafar asSaqid had seven children (two from his first wife), which caused some issues in leadership after his death.
Very little is known about Ismail, except that he was eccentric and that he was appointed to succeed Jafar asSaqid as Imam. However, there's no consensus in Ismaili scholarship on when Ismail died, however non-Ismaili scholarship has settled on his death three years before the death of his father, Jafar asSadiq. Without a living successor, the Shia community split: the majority followed Ismail's younger, more religious brother, Musa Kazim, and a minority followed Jafar asSadiq's second son and heir apparent, Abdullah alAftah. Still, a small group of Shia followed Jafar asSadiq's explanation of Imamat and followed Ismail's lineage to his eldest son. This group named themselves Ismailis.