Original: The union was a result of the Ausgleich or Compromise of 1867, under which the Austrian House of Habsburg agreed to share power with the separate Hungarian government, dividing the territory of the former Austrian Empire between them.
Simplified: They wanted and got the Emperors coronation as King of Hungary.