The opposition is one of the most important things to learn in order to succeed in the endgame. The opposition allows you to make your King stronger than your opponents by simply controlling certain key squares on the board.
The rule of the opposition is: whoever is to move when there is an odd number of squares between the Kings does not have the opposition. So you want to make sure that you move your King to so that there are an odd number of squares between you and your opponent’s King. Another way to look at the opposition is if it’s your turn to move and your King is separated from your opponents by an even number of squares, then you do not have the opposition.
In this example whoever is to move has the opposition. The same rule also applys to diagonals.
What if the Kings do not connect on a rank or file? If that is the case then the rule is to move the King to a square in which each corner is the same color of the square the opposing King is in. As illustrated in example #2.
Example 2: Opposition When Kings Do Not Connect On Rank or File
By moving Kb2 White maintains the opposition as long as the squares within the box are odd.