Why is a magnesium ion essential for ATP activity in enzymic reactions?
As far as I know there are two main reasons for this: 


promoting a nucleophilic attack



  In general, Mg2+ interacts with substrates through inner sphere
  coordination, stabilising anions or reactive intermediates, also
  including binding to ATP and activating the molecule to nucleophilic
  attack (wiki)



 - assists in the leaving a pyrophosphate group and may also facilitate the cleavage of the bond between the α- and β-phosphates by its electron-withdrawing effect. (source)


  wouldn't the presence of mg hinder release of phosphate?


As with all reactions this is dependent of the concentration of the molecules 
involved as stated here: 


  The Gibbs free energy change (ΔG) due to ATP hydrolysis depends upon
  the concentrations of the various participants in the reaction. When
  the concentrations are farther from their equilibrium values, the
  absolute value of ΔG is greater. Under “standard” conditions (i.e.
  concentrations of 1M for all reactants except water which is taken at
  its characteristic concentration of 55M) the Gibbs free energy of ATP
  hydrolysis varies from -28 to -34 kJ/mol (i.e. ≈12 kBT, BNID 101989)
  depending on the concentration of the cation Mg2+. The dependence on
  Mg ions occurs because the positively-charged magnesium ions help to
  stabilize the ATP molecule. However, in the cell the conditions are
  never even close to the standard state values. (source)