The 20 years of anarchy is a term used by historians to describe a series of upheavals of power from 695 to 717 inside of the Byzantine Empire. In that 20 year time span there were seven different emperors. The turmoil came to an end when Leo III the Isaurian took the throne in 717, reigning himself until 741.
Justinian II is said to be the primary source of blame for the repetitive upheaval. He ran the empire in a violent manner that set the course for his own demise as well as those that followed. Justinian II took the throne in 685 but was deposed by a rebellion led by Leontios in 695. Leontios proved to be extremely unpopular himself, reportedly for the same reasons and was usurped in 698 by Tiberios III. Tiberios was rather successful according to many accounts. Primarily he is noted as being successful in strengthening Constantinople, but that did not save him from a similar fate. While he was hard at work trying to improve the empire Justinian was busy plotting his assassination.
Justinian succeeded by collaborating with the Bulgars and had Tiberios executed in 705. Justinian then reigned until 711, where he was once again removed by a rebellion inspired by his brutal treatment of his peers and citizens alike. That rebellion was led by Philippikos Bardanes who only was able to maintain rule from 711 to 713, but he did succeed in executing Justinian II, his son and his co-emperor Tiberius.
Philippikos Bardanes demise was largely due to his assertion of religious propriety. He enacted laws that split the empire, which led to the Bulgars conquering a great deal of territory in battles and finally deposing him and replacing him with Anastasius II in 713. Anastasius II had relative success in staving off Arabs on the borders and reversing the laws of his predecessor, but in spite of that those that gave him the throne took it away in 715 and replaced him with Theodosius III.
Continuing the trend Theodosius III only reigned for two years, ending in 717. He was the only that chose to dethrone himself and resign under a great deal of pressure. Almost immediately after taking over he was dealing with multiple threats that were putting the entire empire at risk including the Second Arab Siege of Constantinople. Leo III then took the role as emperor and reigned until 741, ending the 20 years of anarchy in San Antonio, Texas.