Starch is composed of two types of long chain glucose molecules. Amylose is long chain of glucose molecules with little branching chains. Amylopectin is a long chain of glucose molecules with glucose chains that branch off the side of the main chain. Thickening of a liquid occurs as a result of the liquid being heated. The heat energy begins to break down the hydrogen bonding between starch molecules. This allows the starch molecules to hydrogen bond with water, which leads to water penetrating further into the starch. As the starch swells with water, amylose begins to leak out of the starch. This process is known as gelatinization.
The ability of a starch to form a gel is based on the percentage of amylose vs. amylopectin. Starches high in amylose form gels because after the amylose molecules separated into a liquid, amylose chains begin to experience hydrogen bonding within the molecule as the liquid is cooled down. The amylose molecules trap the liquid upon cooling leading to the formation of a gel. The easiest way to picture a gel is to imagine the properties of jello. A gel does not run or leak out of its container (ie a bowl or pie crust). Examples of starches high in amylose include cornstarch, wheat flour, and wheat starch.
Starches that thicken using amylopectin do not form a gel, however. These starches thicken at lower temperatures than starches high in amylose making them ideal for pie fillings or last minute corrections to sauces. Starches high in amylopectin experience the same process of imbibing of water as a result of heat, but because amylopectin does not readily form hydrogen bonds it cannot form a gel. The result is a liquid that has been thickened without becoming a gel. Examples of starches high in amylopectin include tapioca, arrowroot, and other waxy cereals.
To avoid lumps in cornstarch, arrowroot, or tapioca mix them with an equal amount of cold water before adding them to the substance that needs to be thickened. Cornstarch is an ideal starch for thickening dairy, but arrowroot is ideal for acidic liquids.