# Difference-in-difference vs fixed effect models

I know that fixed effects model can be seen as a generalization of a difference-in-difference model, when periods and groups are more than two.

My question is which are the pros and cons of using a fixed effect model instead of a diff-in-diff one? There are advantages only from a statistical standpoint or there are some also from a practical point?

The difference in differences (DiD) model is actually a type of fixed effects because the differencing gets rid of the individual fixed effects.$^1$ Regarding the pros and cons, it really depends what you want to do. DiD is mainly for causal inference with observational data whereas the fixed effects model primary task is to get rid of the correlation between observed explanatory variables and the unobserved fixed effects.
$^1$ If you have a model $y_{it} = \beta_1 post_t + \beta_2 treat_i + \delta (post_t\cdot treat_i) + c_i + \epsilon_{it}$ where $post=1$ in the treatment period and $treat_i=1$ for the treatment group. The DiD estimator is then \begin{align} \delta = &E[y_{it}|post=1, treat=1] - E[y_{it}|post=0, treat=1] \\ (&E[y_{it}|post=1, treat=0] - E[y_{it}|post=0, treat=0]) \end{align}
If you now substitute the regression equation for $y_{it}$ in here, you will see that all the $c_i$ will cancel, so we get rid of the fixed effects.