Mashing is the process of producing wort from water and malted barley. The water and barley mix is held at a set temperature per the recipe (148 to 158 degrees) in a closed container for about an hour. This mixture produces maltose, a type of sugar, which yeast consumes to produce alcohol.
There are different mashing methods a homebrewer may use. A single infusion mash is by far the most common for homebrewers to choose. Crushed malted barley at room temp is added to hot water to get a mixture at your desired mashing temperature. Most mashes use somewhere in the neighborhood of 1.25 quarts per pound of crushed grain. The temperature of the hot water will have to be higher than the desired mash temperature, because the temperature will drop when the grains are added at room temperature. The exact temperature can be calculated using a mash infusion calculator or brewing software. On my system, I add water at a temperature of 12 degrees higher than my desired mash temp.
A temperature mash, which is more how commercial breweries mash, involves adding water and grain, then raising the temperature to your desired mash temperature. It is more difficult to mash like this using a homebrew setup, but it can be done.
A decoction mash is a style used to make classic German style beers. This mashing method requires the brewer to boil a part of the mash, then mix it with the rest of the mash to raise the overall temperature to the desired mashing temperature. Brewing software is extremely handy to pull this complicated mashing method offf.
Finally, a multi-step mash, is used with unmodified malts or certain brewing adjuncts. This method involves mashing at 105 for an acid rest, followed by a protein rest at 122, and finally your sugar conversion at your desired mash step. To perform this mashing method, you must have some way to raise the temperature of the mash and hold it at that temp for a specified period of time. RIMS and HERMS systems work great for this.
Most homebrewers will be able to make great beer by using the single infusion mash 100% of the time. There will be some styles you with to brew that will only taste just right by using one of the other methods above.
The mash temp will have an impact on the final taste of the beer. A lower mash temp, in the range of 148-152, will produce a drier beer with a lower finishing gravity. More mashing time may be required to completely convert all the available starches in the grain. A higher mash temp, in the range of 155-158, will produce sweeter, fuller bodied beer with a higher final gravity. The wort will have more unfermentable sugars that will not be converted into alcohol.
You can test if all of the starch in the mashed grains have been converted to sugar by a simple iodine test. Draw a sample of the mashed grains and water from your mash tun. Iodine, which is normally brown, will turn blue in the presence of starch. If you sample turns blue, more mashing is required. If it remains brownish yellow, the mashing process is complete.
Check out mash recirculation for more info on mashing.