Understanding the extraordinary magnetoelastic behavior in GdNi