Why is my interaction significance different depending on the model? In this minimal reproducible example, there is an outcome variable and two predictors (age and sex).
outcome <- c(1, 2, 2, 3, 3, 4, 4, 4, 4, 5,
             5, 5, 5, 5, 5, 6, 6, 7, 8, 9)

sex <- c("M","M","M","M","F","M","F","F","M","M",
         "F","F","F","F","M","M","F","F","F","F")

age <- c("C","C","C","A","C","C","C","C","C","A",
         "C","C","A","C","C","C","C","A","A","A")

dt <- data.frame(outcome = o, sex = as.factor(s), age = as.factor(a))

The boxplot suggests there is an interaction:

When I check the interaction as part of a model I get a different statistical significance than when I check the interaction alone.
anova(lm(outcome ~ sex + age + sex:age, dt))

anova(lm(outcome ~ sex:age, dt))

The first gives a p-value of 0.187499 for the interaction term, while the second a p-value of 0.007738.
Can someone explain the difference?

The tests are making different comparisons.  In general, the tests in anova() compare the full model to the model with that term left out.  (Edited to add:  though things are more complicated when interactions are involved; the main effect tests being an example of that.)  In the first case, the full model is
outcome ~ sex + age + sex:age

and leaving out sex:age gives
outcome ~ sex + age

the main effects model.  So in that case you are really testing the interaction, and it is not significant:  in the plot, it looks like C and M both give lower values than the other level (A and F respectively).
In the second case, the full model is
outcome ~ sex:age

Here sex:age is a 4 level factor containing all combinations of the factor levels.  Leaving it out gives
outcome ~ 1

So in this case the test is for any kind of difference at all among the groups, and there's obviously something going on, so it comes out significant.
