A certain type of protein called gluten (glutenin) is responsible for wheat flour's elastic properties. The more gluten in a flour makes it easier for the flour to build up a tough structure able to trap the waste gases of yeast during kneading as well as rise effectively during baking. Less gluten in a flour produces a lighter, less chewier texture such as those found in cakes. The exact amount of gluten in your flour depends on where it was milled and the variations in growth of the wheat crop.
High gluten flour and bread flour is produced from hard wheat. High gluten flour has a gluten percentage of about 12-14% while bread flour contains about 10-13% gluten. Both flours are almost completely made of hard wheat, but some high gluten flours are treated to reduce starch content, raising the gluten content to around 14%. These flours are generally used for making breads. High gluten flour is reserved for breads that are extra elastic such as bagels and pizza.
Cake flour is produced from soft wheat and is low in gluten content (8-10%). This flour is used for making delicate cakes. Baked goods made with cake flour has a tendency to crumble because of the low gluten content.
All purpose flour is made from a mixture of hard and soft wheats. The gluten content ranges from 9-12%. This is the most versatile flour because it can be used to make both cakes and breads. However, breads won't be as chewy and cakes won't be as tender as if you used bread or cake flour.
Pastry flour is also a mix of hard and soft wheat flours with an emphasis on soft. Generally, the gluten content is 9-10% and is often recommended for pie crusts.
Whole wheat flour contains the germ (the embryo of the wheat kernel) and is more flavorful than regular all-purpose flour which does not include the germ. Because the germ is included, there are more nutrients as well as fiber and fat content in whole wheat flour. However, the flour should be stored in the refrigerator to prevent the germ oils from becoming rancid.
Almost all the flour sold is steel ground meaning a large machine with steel hammers or rollers crushes and grinds the wheat kernels down. This is a very efficient means of producing flour, but the steel surfaces heat up with the high speed and volume of wheat being ground. This heat causes some of the vitamins in steel ground flour to be destroyed during the grinding process.
Alternatively, stone ground flour is produced by the relatively slow grinding of large stones together (with the wheat in the middle). This type of flour is harder to find and almost always leaves the germ intact producing whole wheat flour. There is no heat build up, so all the nutrients stay intact as the four is made.
Bleaching or aging is another process that differentiates flours. Bleached flours produce doughs that are less sticky and rise better than unbleached flours. Bleaching can be accomplished by aging the flour over time (the oxidation of the flour causes the yellow pigments to fade) or through a chemical means (usually using chlorine dioxide and potassium bromade to age the flour). The aging process removes some of the naturally occurring vitamin E present in wheat. The flour ends up uniformly white and has (generally) better baking properties.
The texture of the flour is determined by how much sifting (or bolting) is performed at the mill. The degree of sifting will result in a powdery flour or a coarse flour. Prior to packaging, most flours in the United States are also presifted. Presifted flour can be measured directly from the bag by stirring, measuring with a dry measuring cup, and leveled with a straight edge. Unsifted flour needs to be sifted prior to measuring (by volume). If unsifted flour is measured by weight, it should still be sifted prior to use in a recipe requiring sifted flour (assume all recipes require sifted flour).
Enriched flour contain vitamins and nutrients that have been added to offset the loss from the grinding and aging of flour. Usually, niacin, riboflavin, thiamin and iron are added to flours that do not contain wheat germ. In addition vitamin E is often added to bleached wheat. Some brands will also contain additional vitamin A, C, and D.
Some bread flours will have a little bit of malted barley flour added to help yeast growth. In addition, potassium bromate may be included to lend strength and help the dough maintain the yeast gases.
The addition of baking powder and salt produces self-rising flour or leavened flour. When using self-rising flour, simply omit the baking powder and salt from the recipe (leave in any baking soda a recipe calls for).
Outside of the United States, different types of flour may have different names. For example, plain flour is often similar to all purpose flour. However, the regional differences that cause all-purpose flours to vary from U.S. state to state, also cause similar flours from other nations to differ slightly in property from those in the United States.
Whenever possible, flour should be measured using a scale. With a good digital scale with fast response, it is actually easier to measure flour by simply pouring it into a bowl on the scale and stopping when you hit the mark.
If you do not own a scale and need to use a measuring cup, then make sure you use a dry measuring cup (one that measures to the lip of the cup, not to some marking below the lip such as this poor design - please don't buy these). Scoop the sifted flour into the cup and level with a flat straight edge (like a bench scraper or ruler). You'll get really close to 125 g per cup with this technique - but you have to make sure you sift your flour. (One easy and mostly effective way to do this is to store your flour in a large air tight container. I use a pickling jar big enough to hold a 5 pound bag of flour with room to spare. Before measuring, pick up the container and shake it so you incorporate as much of the air in the jar into the flour as possible. It works best if the jar is half air and half flour. Once you've done this, let it sit for a few minutes so you don't get a face full of flour when you open the lid. Then scoop and level.)
When reading a recipe, you should always start off by assuming that it is written with sifted flour in mind. For example, if a recipe calls for 1 cup flour, it should be assumed that it is one cup of sifted flour. The reason for this is that measuring unsifted flour is inaccurate and pretty much impossible to replicate from household to household. If the flour hasn't been sifted, how do you know how much it's settled over time? The amount of settling is dependant on how much the bag has been jiggled during transportation, how long it's been sitting on the shelf, and other environmental factors that are unpredictable. So, one person may scoop store bought "presifted" (which pretty much means unsifted by the time you get home) flour and find that it is actually 20% more flour than grandma who wrote down the recipe normally uses.
Unfortunately, these days, it seems that no one likes to follow standards and American cookbooks seem to be written based on the 140 g per cup "standard" which is nearly impossible to replicate through the scoop and level method. The reason why 140 g per cup is used so much now is that it is in between the ultra-densely settled 160 g per cup and the just sifted 125 g per cup. Using 140 g per cup as a recipe measurement means it's unlikely that anyone will be able to replicate your recipe (unless they have a scale) but no one will be creating a disasterous baked good if they are off by 10%. Unfortunately, 10% can alter the texture of your cookies quite a bit... so measure with a scale and forget all this volumetric nonsense.