There are two major factors that can explain this success. One is military and the other is more political.
Militarily, the Mughals had to be strong in order to conquer India. The Mughal armies were not always as big as those of their rivals, but they were superior. Much of this superiority was due to their effective use of artillery, particularly against their enemies' stone fortresses.
However, the Mughals did not only conquer. They also persuaded the people of India to accept their rule. The Mughals were religiously tolerant and also tended to give Indians places in the government, thus encouraging them to accept Mughal rule.
Thus, by a combination of military prowess and political aptitude, the Mughals were able to take control of much of the subcontinent.