Kellar Autumn of Lewis & Clark College studies gecko adhesion and provides the following explanation:

Geckos have arrays of millions of microscopic hairs, or setae, on the bottoms of their feet. Each seta ends in an array of nanostructures, called spatulae,that function as a dry adhesive. Last year my colleagues and I discovered that gecko adhesion is a function of the geometry of these nanostructures rather than their surface chemistry.

In their resting state, setal stalks are bent proximally like a claw. When the gecko plants its toes, the setae extend so that their tips point away from the body. A small amount of weight and a micron-scale displacement of the toe away from the body may serve to bring the spatulae (previously in a variety of orientations) uniformly flush with the substrate, thereby maximizing their surface area of contact. Adhesion results and the setae are ready to bear the full load of the animals body weight, whether it's scampering up a wall or across a ceiling.

A single seta can withstand 20 milligrams of force and the number of setae a gecko has (approximately 6.5 million) could theoretically support 133 kilograms. This remarkable adhesive capacity raises the question of how geckos can remove their feet from walls. As it turns out, increasing the angle between the setal shaft and the substrate beyond 30 degrees causes detachment. It is likely that stress increases at the trailing edge of the seta as the angle of the setal shaft increases, fracturing the spatula-substrate bonds. The gecko's unusual toe-peeling behavior may aid in reducing detachment forces by removing only a small number of setae at a time.

The reader also inquired whether two gecko feet would irreversibly stick together.

Arrays of gecko setae do not stick to each other. Research on this topic is ongoing, so I can only provide a hypothesis for the mechanism underlying this "anti-self" property. In order for setae to attach strongly to a surface a large number of spatulae must adhere simultaneously. The probability of a spatula from one foot coming into contact with a spatula from another foot is very low. Multiply many small probabilities together, and we arrive at the conclusion that it is extremely unlikely for two feet to become strongly attached to each other.

Nanotechnologist Kostya Novoselov, who works in a lab currently developing tape based on gecko adhesion at the University of Manchester, provides some additional details.

A gecko climbing a vertical surface is a fascinating sight. But it becomes even more interesting when one starts to think about the microscopic mechanisms that underlie the graceful movements of this amazing animal. We don't know the exact way in which geckos vary the attraction between their toes and the surface, but recent experiments have provided a probable scenario.

Kellar Autumn and his team have shown that the force required to detach a gecko's toe from a substrate depends crucially on the angle between the setal hairs and the surface. Basically, the situation resembles detaching a piece of adhesive tape from a table. It would require enormous effort to remove a piece of sticky tape from any surface by simply pulling on it perpendicular to the surface. But it couldn't be simpler to peel it away by applying moderate force parallel to the tabletop.

It appears that geckos take this approach when climbing a vertical surface. A gecko's foot sports a few hundred thousand setae, each about five micrometers thick and 100 micrometers long. A spray of hundreds of very thin (0.2 to 0.5 micron) whiskers with spatula-shaped ends caps each seta. The setae are quite flexible, and it seems that the gecko can change their orientation and strain. When approaching the surface, the animal makes the setae rigid and angles them such that the flat spatulae engage with the substrate, thereby maximizing the attractive force between the toe and the surface. To detach, the gecko increases the angle by changing the seta's shape and peeling it away. Due to its flexibility and incredibly small size, the spatulae can be brought into firm contact with the surface where this force becomes significant.

The attractive forces between a gecko's two palms would probably be much weaker than the attraction between the palms and any surface the gecko climb on, because the effective contact area between the two sets of setae is smaller than that between the setae and a free surface.