How does a pickup work?
The magnets create a magnetic field through the coil and around the string. The vibrating string interrupts the magnetic field, or otherwise causes it to fluctuate, this causes a current to flow in the coil. Ok so far?
Now if the string is very close to the pole it may cause the field to fluctuate to its maximum extent i.e. the fluctuation cannot get any greater no matter how hard you pluck the string: we have reached magnetic saturation (for the string). We do not have strings that close because they hit the pickup, but we often identify a lesser effect as a form of 'natural' compression. At saturation the coil will generate a certain maximum amount of current, as the string vibration decays from saturation the amplitude of the signal initially remains high but the current lessens, as the note decays further, the current lessens too, and the timbre of the note changes because the waveform changes: we hear this as picking dynamics, the initial heavy attack and decay of an overdriven power chord, yet still being able to pick individual clear loud notes by picking lightly.
If we however move the pickup away from the string, we increase the dynamic range. No longer do we reach saturation on any but the most violent attacks, we can achieve clear chord work by picking more lightly, individual string take on a bell-like ringing quality. Move the pickup too far away and the notes become rather anaemic.
It may be noted that bass strings being thicker cause a greater disruption of the magnetic field than do the treble side. This means that the bass notes should be louder than the treble. This is compensated by: the way we hear - we require bass notes to be louder; the way the pickup is wound - as an inductor in a resistive circuit it is more efficient towards the treble; by the way we adjust the pickup poles or slant the pickup - we are familiar with staggered poles and compensating for wound vs plain 3rd strings.
In practice we adjust the pickup height to compromise between the close in sustain and frissance, and the far away quiet sweet clarity.
It should also be noted that magnetism is known as a weak force, its effect drops off very rapidly with distance, something like proportional to inverse cube of distance (actually rather complicated), so small changes in distance have a lot of effect: the pickup needs to be within a few millimetres of the string.