Essentially, ANOVA is used for test of means for two or more populations. It has a metric dependent i.e. measured using a ratio or interval scale. For a two-way ANOVA, there are two independent variables that are non-metric or categorical in nature. These independent variables are called factors. ANOVA seeks to identify sources of variation in the numerical dependent variable/response variable. The variation in the response variable (about its mean) is explained either by the independent variables (factors) or is unexplained (random error.
Variation in response variable about its mean = Explained variation + Unexplained variation by factors (random error)
Each possible value of a factor or combination of factor is called treatment. Sample observations within each treatment are viewed as coming from populations with different means possibly. It is tested whether each factor has a significant effect on the response variable. ANOVA uses F distribution with null hypothesis that all means are equal.
For example: A researcher would use two-way ANOVA to examine whether the product use (heavy, medium, light and non-drinkers) and brand loyalty (loyal and non-loyal) have different preferences towards a brand of soft drink.