Elastic and spin-changing inelastic collision cross sections are presented for cold and ultracold magnetically trapped NH. The cross sections are obtained from coupled-channel scattering calculations as a function of energy and magnetic field. We specifically investigate the influence of the intramolecular spin-spin, spin-rotation, and intermolecular magnetic dipole coupling on the collision dynamics. It is shown that $^{15}$NH is a very suitable candidate for evaporative cooling experiments. The dominant trap-loss mechanism in the ultracold regime originates from the intermolecular dipolar coupling term. At higher energies and fields, intramolecular spin-spin coupling becomes increasingly important. Our qualitative results and conclusions are fairly independent of the exact form of the potential and of the size of the channel basis set.