Dark magic represents unique abilities. Souma's ability allows him to control objects from remote distances. It may have been mentioned earlier, but the former queen, inheritor of the royal bloodline, was a user as well. Her ability allows her to send memories to the past and create alternate timelines. She used it the first time to decide her husband; every other king brought the country to ruin, in one way or another. The only one to "survive" was King Albert, who was mediocre, but liked by his subordinates, and taken advantage of blindly by political opponents.
In the alternate timeline, the kingdom summoned Souma, and he solved the money problem by cracking down on the corrupt. However, he was not made king, or given a notable position of power at all, to appease complaints from dissatisfied nobles, both corrupt and opportunistic. With little political power of his own, and no subordinates at all, the corrupt nobles, wanting revenge, took bribes from Amidonia, and weakened their own country from within. Souma did not solve the food crisis because they didn't allow him to pass any reforms, they caused a revolt. During that revolt, Amidonia attacked, and Souma and the princess reportedly burned to death in the royal castle.
The queen created a new timeline, then told her husband, who then told the beastman duke. The beastman duke decided, that since he was getting on with age, and since he loved the king and her daughter, he would pretend to raise a flag of rebellion, and bring the corrupt under his side and keep an eye on them. The king then gave Souma the strongest position possible, so he could pass reforms, and acquire personnel to replace the ones that walked out when he extracted money from the nobles. Souma's mistake in both timelines was that he did not execute the treacherous nobles that would lead to his downfall, so under the pretense of gutting a rebellion, all the nobles would die because the beastman duke was never playing to win from the start. An unfortunate undersight was that the duke's close friend, in charge of the air force, would join him out of camaraderie.