Hungary was an axis ally in the eastern front of WW2, contributing troops to the Battle of Stalingrad. After the II. Hungarian Army was destroyed at the river Don in January 1943, the hungarian government started looking for a way to drop out of the war. They initiated secret negotiations with the british (they hoped the allies would land in the Balkans), and the german intelligence found this out. By March 1944, the Soviet troops were getting closer to the hungarian border, so a Hungary leaving the war would have created a huge gap through the Carpathean mountains, similar to what happened when Romania switched sides. Also, Hungarian resorces like the Zala oil fields were important for Germany, they couldn't risk losing those.