Although these two essays are on different subjects, what they have in common is that Madison is saying that there needs to be competition between various people and points of view in order to prevent tyranny. In Federalist 10, Madison argues that creating a larger union is the way to prevent one "faction" from dominating the others. In a large union, many factions will compete for power. In Federalist 51, Madison argues for three branches of government with separation of powers and checks and balances. This is necessary because "ambition must be made to counteract ambition."
In both cases, Madison is saying that there needs to be competition so that no one faction or part of government can be dominant.