its a combination of things.... the 2.4 ghz spectrum that wifi runs on is impacted by building materials and does not penetrate walls/floors as well as devices that use the 900mhz spectrum. Cordless Phones, Microwaves, Cell Phones and other 2.4 ghz wireless devices will all be jockin for use of the spectrum and can impact signal strenght...
the main diff between D, G, N ect... is not so much the range, it is the max data transfer rates.
The wireless card in your device will play a big part in picking up the signal. You can build a directional antenna with a pringles can and 3.00 bucks worth of parts from radioshack that can pick up a wireless D router 5+ miles away (with line of sight)...... get a good card and you should be fine...