Air conditioners remove large amounts of humidity from the air in your house as part of the process of cooling it. That water condenses inside the air conditioner unit where it is supposed to flow into a drain pan for disposal. When that doesn't happen properly, the water may leak out the front of the unit and onto your carpet.
Clogged Drain Tube
Moisture that collects inside the air conditioner normally drains through a small PVC tube that runs out the back of the machine in older models. Over time, dirt and dust collect inside this tube until it becomes completely blocked. When that happens, water continues to collect in the drain pan until, with nowhere else to go, it spills over the edge and onto the carpet below. Blowing out the line normally fixes the problem.
Ice on the Coils
If the temperature outside is too low (below 60 degrees Fahrenheit for most models), ice will form inside the air conditioner. Since ice can't flow into the drain pan and out of the drain tube like water, the system backs up. When the ice starts to melt after temperatures rise, it may leak out of the front of the window unit. If the carpet is dry in the evening and wet in the morning, ice is the likely culprit.
If warm, humid air from outside can get around the edges of a window air conditioner, it will hit the cool metal front of the machine and condense into water droplets. If the difference between inside and outside temperature and humidity is great enough, the condensation will eventually drip onto the floor at the front of the unit. These droplets of condensation will show up when you shine a flashlight under the bottom edge of the air conditioner.
Improper Window Unit Installation
For the drain on a window air conditioner to work properly, water must flow from the front of the machine toward the back, so the unit should be installed with the back about an inch lower then the front. If the air conditioner was installed level or sloping down toward the front, water will dribble over the front edge of the shallow drain pan and onto the carpet instead of running into the drain tube at the back.