What is anova() really doing when comparing models? When we use anova() function to compare two or more models, what test is it actually performing? I don't think that's an "Anova" per si, right. Would it be a "a likelihood-ratio chi-squared test"* or anything else?
Example:
> mod1 <- lmer(Y ~ X1 * X2 + (1|ID), data = data, REML = F)
> mod2 <- lmer(Y ~ X1 + X2 + (1|ID), data = data, REML = F)

> anova(mod1, mod2)

Data: data
Models:
mod2: Y ~ X1 * X2 + (1 | ID)
mod1: Y ~ X1 + X2 + (1 | ID)
     npar    AIC    BIC  logLik deviance  Chisq Df Pr(>Chisq)    
mod2    5 51.649 63.803 -20.824   41.649                         
mod1    6 40.504 55.089 -14.252   28.504 13.144  1  0.0002884 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


*

*Question: What is the correct way to report this test? Thanks in advance!

*follow-up: Is it ok to say "we assessed the model godness of fit by a a likelihood-ratio chi-squared test" ?


Based on the paper that presents the lme4 package you are correct, it is a chi-square test that the anova function will output when called with multiple models as arguments. More technically they say:

The output shows χ2
statistics representing the difference in deviance between successive
models, as well as p values based on likelihood ratio test comparisons.

I don't know how to report this test because every field has its own traditions in presenting statistical tables results. However, the output gives some things that would be expected. P values for one, basic statistics like the AIC are known in some fields, or the deviance in others. I would check the literature to see how those are usually presented.
As for the last question, I wouldn't say that the chi-square statistic derived from the difference of the deviances of two candidate models would be a goodness of fit measure. Those usually rely solely on the residuals or deviance of a single model and on the asymptotic properties of those under the chosen model and comparing them with the saturated model (which is the model where there is one parameter for each observation). I would add a residual analysis as a good measure of goodness of fit as well.
