Mao and Gandhi diverged on many philosophical aspects of struggle, and ultimately shaped their ideas in the context of distinct struggles. However, there was one aspect of their practice that united them in a profound way -- their love for, and their close relationship with their people.
We could say of Mao also what W.E.B. Du Bois said of Gandhi, "He studied Man. He travelled all over India and travelled in the dirty, crowded third-class so as to meet and know the masses. Probably no modern leader ever had so complete and intimate contact with and knowledge of the great mass of his fellows as Mohandas Gandhi."
Mao and Gandhi both identified themselves completely with the people. They lived among and like them, and saw in the peasantry the potential to transform the whole of society. In return, the people trusted and revered them as their leader. Their love for the people formed a close bond between them and the people that many intellectuals found difficult to understand, and attacked the struggle as a 'cult of personality'.
Mao was from a peasant family. As a child he was influenced deeply by his mother's Buddhist beliefs, and took up the religion himself as a teen. He was familiar with Confucian philosophy, and often drew on it for metaphors and tales to demonstrate revolutionary ideas. In this way, he knew the heart of Chinese civilization and drew on it, despite the anti-Confucian position he took up during the Cultural revolution.
Gandhi undertook a deep study of the Gita and other Hindu texts, and re-interpreted them for his time. At the same time he revived the Indian tradition of synthesis, drawing on Christian and Islamic texts. Gandhi stressed that the essence of Indian civilization stood for the search for truth.
Finally, as revolutionaries who consolidated the revolutionary forces -- Gandhi with the Congress, and Mao with the Communist Party of China -- they believed in a principled politics.
Here we share an article written comparing the two revolutionaries: https://www.hindustantimes.com/india-news/can-gandhi-and-mao-ever-meet/story-BgRSjpcXtix5VctV54r4dK.html