Bonferroni corrected comparisons v. post hoc tests

I am running a 2 (gender) x 3 (condition) ANOVA. When I compare the results yielded by the compare main effects option with Bonferroni correction to the results given by post-hoc tests with Bonferroni correction, the results (p-values, estimated differences, CIs) differ. Can someone help me understand what is different about these two ways of comparing levels? Does the compare main effects option adjust for the other variable in the model while the post-hoc tests do not? Which is the appropriate approach?