Square nuts have four-sides (vs the standard six-sided Hex Nuts). Due to their larger surface contact area they tend to naturally be more resistant to loosening. The greater surface area also allows higher torque to be applied to the nut over traditional Hex Nuts. The downside is you'll need to use a wrench rather than a socket to tighten.