The fermentation process relies on adding yeast to a sugar solution. In beer, the main sugar source is traditionally malted barley. Malted barley is barley grain, which has been allowed to begin germinating or sprouting. In this germination process, the starches and proteins present in the grain begin to be broken down by enzymes in the grain. The maltster stops the malting process at an appropriate time and then dries and perhaps roasts the grain for the brewer's use.
Barley malt is crushed to expose the inside of the kernel.
These crushed grains are then steeped in water at an appropriate temperature, usually around 145-158 degrees Fahrenheit. The enzymes continue to reduce the proteins and starches by breaking them down into smaller molecules. The starches eventually become sugars in the mash. Some sort of large straining device - similar in spirit to a colander for draining pasta usually does this. The major difference is that in draining pasta, you keep the pasta and throw out the water.