While he was Jarl, the Reachmen, former rulers and natives of The Reach, seized the opportunity to conquer Markarth in a savage uprising, due to the Empire's resources being focused on the Great War. Hrolfdir was ultimately unable to quell this uprising and was deposed by the Reachmen, however he and his family managed to escape the city and sought help to reclaim it.
Hrolfdir made contact with the son of the Jarl of Windhelm, Ulfric Stormcloak, and promised him and his militia free worship of Talos within Markarth in exchange for liberating the city from the control of the Reachmen. Ulfric and his men agreed, and successfully retook the city, captured the Reachmen's king Madanach and drove the remaining hostile Reachmen from the city who then fled into the wilderness and pledged to cut a bloody hole into the Reach until the land was theirs once again, dubbing themselves the Forsworn. After reclaiming Markarth, Hrolfdir was brutal to the Reachmen usurpers and their alleged conspirators. He was said to have executed children of alleged Forsworn sympathizers and unjustly imprisoned those accused of colluding with Forsworn usurpers. However, this might have been under pressure of Ulfric Stormcloak, who allegedly held the city at the time, including the right to decide who could and could not enter the city. Even so, Braig's story and Thonar's Journal seems to imply Hrolfdir had agency on who to execute. Regardless of who did the executions, those of the Forsworn who didn't run were killed, except for Nepos the Nose and a handful of other Forsworn, including Madanach.
Shortly after the city had been liberated, a large group of Thalmor arrived in the city and demanded the arrest of Ulfric and his men. Refusal to obey the Thalmor's demand would have violated one of the terms of the White-Gold Concordat that forbids the worship of Talos. For Hrolfdir the choice was clear, not wanting to risk another war with the Dominion, he agreed to have Ulfric and his men arrested and personally aided the legion in the capture of Ulfric Stormcloak. Ulfric and his men called it "The Markarth Incident;" it was the founding day of the Stormcloaks and can be considered where the Skyrim Civil War originally started.
Sometime after the Markarth Incident, Jarl Hrolfdir tried to make peace with the Forsworn but was instead murdered by them. After Hrolfdir was killed, his shield was taken (presumably from his corpse) by the Forsworn and given to their Hagraven matriarchs.