So I'm super confused. Looking online for example:here or here or here or in any other website I could find ANOVA is " used to determine whether there are any statistically significant differences between the means of three or more independent (unrelated) groups" or "are useful for comparing (testing) three or more means (groups or variables) for statistical significance" or "ANOVA is used to compare differences of means among more than 2 groups.".
However I'm studying linear regression models and both in simple and in multiple linear regression, our lecturer uses ANOVA in a totally different way!
We use ANOVA to compare the linear regression model (where response depends linearly on explanatory variable) with the simpler "constant" model where there is no relationship between response and explanatory variable. (and similarly for multiple linear regression we compare whether we need $p>q$ explanatory variables or only $q$ are enough)
Hence is my lecturer teaching us something wrong? Are they two different types of ANOVA but with the same name? Or are they the same thing and I don't see the connection?
EDIT
Here is what the lecture notes say for simple linear regression (similar for multiple):