What does the distance between a pickup and strings do for the sound? Should active and passive pickups be treated differently?
The distance from the pickup to the strings determines - in simple terms - the strength of the magnetic field acting on the strings. Since a standard magnetic pickup (active or passive) is an electromagnetic transducer, the output voltage is generated when a string vibrates in a magnetic field.
So far so good, what of the pickup height? The stronger the magnetic field around the string - achieved by bringing the magnetic polepieces closer - the higher the output generated. However, in this world you never get something for nothing: a stronger magnetic field will dampen the vibration of the strings, decreasing sustain.
Thus, finding the right pickup height is a matter of compromise and experimentation. You'll probably want the pickups high enough to generate a healthy signal, but low enough to allow the strings to vibrate freely. The exact height will depend on the strength of the magnets in the pickup.
Active pickups simply incorporate additional preamplification circuitry, so the principle is the same as for passive pickups.
There's one more important thing the answers so far haven't mentioned: a pickup's output signal doesn't follow the string movement simply in a linear fashion, but in a rather complex relation depending on inhomogenity of the magnetic field, coil geometry etc., and the closer you get the more nonlinear. The result is somewhat similar to a gentle but very asymmetric tube overdrive: you add some (predominantly even) overtones, and "straight-smear" inharmonicities. The result (in particular in connection with the increased inharmonicity through magnetic damping) means that a pickup close to the strings can sound something from agressive-growl to shrill-clang.
Apart from that, these nonlinearities behave quite unlike when you distort the entire guitar signal: there's no intermodulation between different strings (what makes powerchords fat and jazz chords muddy), nor dynamic compression that most distortion has as side-effect. So adjusting a pickup closer sounds very different from boosting a tube input gain to the same final level: more "direct", "fast", "wide", "hard", whereas a pickup further away with higher gain sounds rather mellow, sustained, "smooth", "bound".
As mentioned, having the pup close to the strings gives a hot signal and increases the magnetic dampening, but there is also an effect on tone as well. IIRC, having the pickup near the strings is more trebley and having them lower is more middy. (But it may be the other way around). Additionally, with most humbuckers having at least 1 coil with adjustable pole pieces, you can set the pup low and jack up the poles to get a bit of a blend, or set it high with the poles screwed down as far as poss. These sort of settings are far more subtle than the type of pup and moving between bridge and neck positions, so you'll need to experiment to find out what works for you, if you can even tell what's going on.
a good place to start as to string distance from string to pick-up pole are...
While fretting a note on your gits highest fret on the High E string the distance from the string to pick-up pole should be the thickness of a "DIME" for a Neck Pick-up
and the thickness of a "Nickel" for a Bridge Pick-up
REPEAT: on your Low E string