  Mn$_3$GaC undergoes a ferromagnetic to antiferromagnetic, volume
discontinuous cubic-cubic phase transition as a function of temperature,
pressure and magnetic field. Through a series of temperature dependent x-ray
absorption fine structure spectroscopy experiments at the Mn K and Ga K edge,
it is shown that the first order magnetic transformation in Mn$_3$GaC is
entirely due to distortions in Mn sub-lattice and with a very little role for
Mn-C interactions. The distortion in Mn sub-lattice results in long and short
Mn-Mn bonds with the longer Mn-Mn bonds favoring ferromagnetic interactions and
the shorter Mn-Mn bonds favoring antiferromagnetic interactions. At the first
order transition, the shorter Mn-Mn bonds exhibit an abrupt decrease in their
length resulting in an antiferromagnetic ground state and a strained lattice.
