Nature of the first-order magnetic phase transition in giant-magnetocaloric materials