James Madison wrote this quote in his federalist paper #51. He referred to the new system of the government which the founders were always wanted to create for the nation. Madison wanted the separation of powers in between three branches of the government. Before he proposed the constitution, the power was vested in one single person and there were no checks and balances to protect the people from the government. Then Madison came out with his innovative idea of a new government where it shapes the power across the three branches and he added the idea of checks and balances to maintain the power among them.
Madison knew that the power of the new government can make one branch more powerful than others. So he developed a structure of a government where the people get the protection from their government and the government protects itself from the branches. Each branch gets the power to check and balance other branches ambitions. By this process no one’s ambition gets more powerful than others.
However, Madison tried to maintain a proper balance of power among the branches of the new government with the help of the new constitution. His system of checks and balances might not be the best option to maintain the power of the government. But it is true that Madison’s thought holds our nation more than two hundred years together and we are still good to go further.