Let's say you have 3 different methods for improving reading scores in grade 5 children: Method 1, Method 2 and Method 3. You randomly assign 20 children to each method and measure the change in reading score achieved by these children from the start to the end of each method's administration.
If, when you set up the study and prior to collecting any data, you decide that you are only interested in seeing how Method 2 compares with Method 3, you are going to conduct a planned comparison between the mean change in reading score between Method 2 and Method 3 once the data become available. This decision should be driven by subject matter considerations. Because the planned comparison involves only two methods, it is a pairwise comparison between two mean changes in reading score.
What if you wanted to test a slightly different hypothesis when you set up the study and prior to collecting any data? Namely, that the Novel methods (i.e., Methods 2 and 3) made a difference relative to the Standard method? Then you would need to test a planned composite (or complex) hypothesis which will enable you to compare the mean change in reading score for the Standard method versus the average value of the mean changes in reading score for Methods 2 and 3.
If, when you set up the study, you don't single out any specific comparisons you are most interested in making concerning the three methods, then you can perform posthoc comparisons once you collect the data. These will consist of all pairwise comparisons between the three methods. Each comparison will enable you to compare the mean change in reading score between the two methods it considers.
Now, assume you want to conduct a slightly more complicated study, where you keep track not only of the change in reading score for each child but also their gender (male or female). You will consider a model which relates the change in reading score to Method, Gender and their interaction, since you suspect that the effect of Method might be different for male students compared to female students.
If you find a significant interaction between Method and Gender in your model after fitting it to your data, that simply means that your data provide evidence that the effect of Method is different across Genders. But you have to investigate what that means.
If you consider just the female students, you are going to have to compare the mean changes in scores for these students across the three methods to see if you find any evidence they are not all the same. (This is the same situation as you had in the simpler study when you had to perform posthoc comparisons.) So one possibility is to use post-hoc comparisons to find differences between any pairs of methods for the female students only.
If you consider just the male students, you are going to have to compare the mean changes in scores for these students across the three methods to see if you find any evidence they are not all the same. Again, one possibility is to use post-hoc comparisons to find differences between any pairs of methods for the male students only.