It's all done for tone manipulation. Close to the bridge the strings do not have a wide amplitude resulting in lower output from a pickup (as compared to the same pickup mounted further from the brisge.) The heavier the string the greater the problem and even more so for wound strings. This is why Leo slanted bridge pickups starting with the esquire.
Although what he actually did was move the treble side 'closer' to the bridge because he found that he could get better treble response that way. Early electric guitars and guitar amps were rather dark overall. In the early days much of what was being done was don in a search for brighter tone.
Then there is the effect of moving the pickups in relation to the various harmonic nodes - this can subtly alter the output, sometimes less subtly when using a humbucker or any other large coil pickup - those that have a big string 'window' and so are more apt to experience phased cancellation at the higher frequencies.
Some guitars, and even some early pickup designs, have sliders to allow the player to move the pickup around under the strings.