We present a statistical study of the glitch population and the behaviour of the glitch activity across the known population of neutron stars. An unbiased glitch database was put together based on systematic searches of radio timing data of 898 rotation-powered pulsars obtained with the Jodrell Bank and Parkes observatories. Glitches identified in similar searches of 5 magnetars were also included. The database contains 384 glitches found in the rotation of 141 of these neutron stars. We confirm that the glitch size distribution is at least bimodal, with one sharp peak at approximately $20\, \rm{\mu\,Hz}$, which we call large glitches, and a broader distribution of smaller glitches. We also explored how the glitch activity $\dot{\nu}_{\rm{g}}$, defined as the mean frequency increment per unit of time due to glitches, correlates with the spin frequency $\nu$, spin-down rate $|\dot{\nu}|$, and various combinations of these, such as energy loss rate, magnetic field, and spin-down age. It is found that the activity is insensitive to the magnetic field and that it correlates strongly with the energy loss rate, though magnetars deviate from the trend defined by the rotation-powered pulsars. However, we find that a constant ratio $\dot\nu_{\rm{g}}/|\dot\nu| = 0.010 \pm 0.001$ is consistent with the behaviour of all rotation-powered pulsars and magnetars. This relation is dominated by large glitches, which occur at a rate directly proportional to $|\dot{\nu}|$. The only exception are the rotation-powered pulsars with the highest values of $|\dot{\nu}|$, such as the Crab pulsar and PSR B0540$-$69, which exhibit a much smaller glitch activity, intrinsically different from each other and from the rest of the population. The activity due to small glitches also shows an increasing trend with $|\dot\nu|$, but this relation is biased by selection effects.