Map phase: Each Map function reads a chunk of the input file and outputs a set of intermediate key-value pairs, where the key is a word and the value is the number of occurrences of that word in the chunk.
Shuffle phase: The intermediate key-value pairs are sorted and partitioned by key, so that all the occurrences of each word are grouped together.
Reduce phase: Each Reduce function takes a word and a set of occurrences as input, and outputs a key-value pair where the key is the word and the value is the total number of occurrences of that word in the input file.
The MapReduce framework takes care of the parallel processing, distribution, and fault tolerance of the computation. This allows it to process large datasets efficiently and reliably, even on clusters of commodity hardware.