A wireless network has to transform data packets into waves to send them across the air. It does this by modulating the digital signals and then transmitting them by radio. The reverse happens when a wave is received; that is, it's transformed back into digital data. As part of that process, a signal is encoded before it's sent, and decoded at the other end.
Encoding algorithms, of which there are dozens, dictate the data rate a client gets. In other words, the speed of a wireless connection is governed by the encoding algorithm being used. For any given client-AP connection, the cleaner the signal, the better the encoding and the higher the data rate. As a client moves farther from an AP, the signal strength is reduced because of attenuation. The encoding rate will change to compensate.
Encoding rates are negotiated between a client and an AP when the client attaches to that network. APs advertise their capabilities to clients, and the client decides which rate to choose. Wireless standards (802.11a/b/g/n) have a set of data rates that must be supported, as well as optional data rates that can be used if both the endpoint and the AP can agree. The client's choice of data rate is based on factors such as signal strength and the signal-to-noise ratio (SNR). The client also decides when to change the encoding rate, if necessary.
In addition to encoding algorithms, radio signals can be adversely affected by a variety of factors, including obstacles blocking the radio frequency (RF), the distance from the AP to the client, a high degree of ambient RF noise (called the noise floor) and power mismatches, in which an AP with radio power that's too high may not detect a client that's farther away.
Another common hazard in wireless networking is RF interference. The frequencies we use in WLANs are part of the spectrum set aside by the FCC for general use (that is, without the need to get a license). This is a convenience for manufacturers, but it also means there are a multitude of devices operating in the same frequency bands, which may cause interference. The 2.4 GHz band is an especially crowded one. For the time being, 5 GHz is less crowded, and so a great option for avoiding interference.
Unintentional interference can come from all types of devices, including other wireless networks, rogue APs, neighbors' APs and chatty clients. Non-WLAN equipment can also cause interference; this equipment can include microwaves, wireless cameras, Bluetooth, cordless phones, municipal Wi-Fi on 802.11, and really anything wireless that may be in the ISM and U-NII bands.
It's also worth noting that interference can come from your own APs if they're not properly placed or configured. If you have a single AP with dual radios and use both radios in the same frequency, then the rear lobes of the signal often cause interference.