When Henry III died with his heir thousands of miles away, there were contingency plans in place. The first thing to note is that Edward was recognised as king quickly - they didn't wait for him to come home. Edward became king on 20 November 1272, just 4 days after Henry's death. Edward also enjoyed popular support among the nobility, so there was no significant appetite to subvert the crown at that particular point in time. As Henry was dying, he asked leading noblemen to swear loyalty to Edward as the new king, which they did. This ensured that Edward's succession would be smooth, and that the crown would be waiting for him whenever he happened to get home.
In the meanwhile, a council would rule in the king's stead. Henry's health had been deteriorating for some time, so care was taken to integrate many of Edward's own people into the royal court. Before leaving on crusade, Edward had appointed his own little regency council to look after his interests while he was away, which had the authority to act in his name. It comprised the earl of Cornwall, the archbishop of York, Roger Mortimer, Philip Basset and Robert Burnell. By the time Henry died, these men were already part of the royal court and held positions within the government. This basically meant that there was a government-in-waiting ready to go when Henry inevitably kicked the bucket. This didn't go entirely to plan though, as Philip Basset and the earl of Cornwall died around the same time as Henry.
One of their first acts was to convene parliament, with the intent to gather a large and broad parliament in January - all the barons, earls, bishops, abbots etc. as well as four knights from each shire, and four burgesses from each town. With representatives from all over the kingdom gathered in one place, it was easy to assert Edward's authority. A motion was put before them to confirm Edward's accension to the throne, which passed easily. Parliament then set about filling vacant positions within the government, as Henry was not the only one to have died. Most notably, the important position of chancellor was empty. It was filled by Walter Merton, who had held the position before from 1261–1263. The general theme was to put reliable people in positions of power, and not rock the boat. This was a caretaker government.
Over time, Robert Burnell became the central figure in the ruling council. Although Edward had appointed his deputies, he had not clearly spelled out their authority or their hierarchy. But Burnell, a very experienced civil servant who had risen through the ranks of the government and Edward's own household, gradually became the central figure. Technically speaking, if the king was incapacitated it was the chancellor who was next in line, and it was traditional for chancellors to wield authority in the king's name in the king's absence (such as when Richard I embarked on the Third Crusade). But Edward's pre-existing appointment of regents made things complicated. Merton was technically the highest ranking member of the government, but he effectively answered to Burnell. Burnell had been given sweeping powers to act in Edward's name, and that was what he was going to do. Merton was a weak man anyway - some of Burnell's letters reveal Burnell's frustration at Merton's apparent inability to act autonomously. Writs and edicts were issued in Burnell's name, and letters to the government were usually addressed to Burnell personally.
But Burnell was a civil servant, not a military man. In the event of trouble he would be of limited use. Another of Edward's surviving deputies, Roger Mortimer, would fill the role of enforcer. In 1273, the dukes of Gloucester and Lancaster were fighting over a castle they both had claims to. Burnell ordered the local sheriff to seize the castle and hold it until the matter could be settled. A second letter informed them that if they did not comply, he'd send in Mortimer. When hostilities resumed between Wales and England, it was Mortimer who led the armies and was in charge of the war.
In 1274, as Edward arrive back in Europe, him and Burnell were back in contact and Edward gradually took more of a role in leadership as he got closer to England. He appraised Burnell's performance as generally good, though he was angered that a trade dispute with Flanders had effectively been lost. Other than that though, he was pleased and when Edward was coronated, Merton was removed as chancellor and the position was given to Burnell. Burnell would continue to be the de facto ruler of England whenever Edward was otherwise engaged.
So it was run by a council which had been prepared for the job during Henry's last months as king. Over time, Burnell became the leading member of this council, with Mortimer as his enforcer and Merton as his puppet chancellor.