It basically counts the words in each document (map phase), while in the reduce phase it accumulates the data as per the document spanning the entire gathering. Eventually, during the map phase, the input data is divided into splits for analysis by map tasks executing in parallel across the Hadoop framework.