Darrel G. F. Long, a sedimentologist at the department of earth sciences at Laurentian University in Sudbury, Ontario, explains.
Quicksand is a mixture of sand and water, or sand and air, that looks solid, but becomes unstable when disturbed by any additional stress. In normal sand, grains are packed tightly together to form a rigid mass, with about 25 to 30 percent of the space (voids) between the grains filled with air or water. Because many sand grains are elongate rather than spherical, loose packing of the grains can produce sand in which voids make up 30 to 70 percent of the mass. This arrangement is similar to a house of cards in that the space between the cards is significantly greater than the space occupied by the cards. The sand collapses, or becomes 'quick,' when additional force from loading, vibration or the upward migration of water overcomes the friction holding the grains together.
Most quicksand occurs in settings where there are natural springs, either at the base of alluvial fans (cone-shaped bodies of sand and gravel formed by rivers flowing from mountains), along riverbanks or on beaches at low tide. In such cases, the loose packing is maintained by the upward movement of water. Quicksand does occur in deserts, but only very rarely: where loosely packed sands occur, such as on the down-wind sides of dunes, the amount of sinking is limited to a few centimeters, because once the air in the voids is expelled the grains are too densely packed to allow further compaction.
Answer originally published on October 7, 2002.