The quick answer is sediment suspended by water. Sediment gets its strength from the contact of mineral grains against each other. When water keeps these grains apart, the sediment loses its cohesion and basically becomes a thick liquid. If you walk on it, you lose all traction and start to sink.
Quicksand is not necessarily sand. In fact, the finer-grained silt or clay is easier for water to lift, thus quicksand is more common in fine sediment. Perhaps it should be called quicksilt instead, or quickmud—since "mud" is the official geologist's name for mixed sand, silt and clay.
Quicksand stays quick as long as water is moving upward inside it. That can happen in several different settings. For example, after a period of abundant rain, the water may move downslope below the ground surface and emerge at the base of a steep slope and produce quicksand days or weeks later. Wherever a natural spring occurs, quicksand may form nearby. In areas near glaciers, the moving ice can create pressures on the groundwater that create quicksand patches. And where a high-running river reaches the sea, the excess water can move easily through the beach sand to make soft ground.
In very few places do these processes create deep pools of quicksand like those in the movies. Usually quicksand is shallow, a threat only to wet your shoes.
There is one more factor that can turn ordinary ground to quicksand, just as earthquakes can produce liquefaction to make structures fail: the impact of human feet. If the soil is really soupy already, the force of your steps can stir the sediment into losing its strength. Test this at the beach some time, down next to the surf.
In the unlikely event you find yourself in quicksand, do not struggle, just relax and float. You will not sink in the dense fluid. Contemplate your situation, stuck in an old movie! Then, very slowly, move yourself to firm land again. And be more careful out in the wilds.
PS: So why don't they have quicksand in today's movies? I don't believe it's because existential postmodern malaise has vitiated our inherited cultural notions of natural threats. No, quicksand nowadays is just a hapless, worn-out cliché, and that's all there is to it (although I do have a hypothesis about it). Maybe in a few more years a new generation of directors will rediscover its simple joys. And in 2010, Daniel Engber devoted a nice long article to just that question over at Slate.