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 reason why they are different is that in one model you included the main effects and the other model you only included the interaction term. This will yield different p-values.
These two models would be the same:
anova(lm(outcome ~ sex + age + sex:age, dt))

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

Note the * notation in the model means it includes the main effects and the interaction and the : only means the interaction term.
