# 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.
The key difference is that DiD requires the so-called common trends assumption. This assumption says that in the absence of the treatment, the outcomes of the treated and control group units would have evolved in a parallel way. It would look something like this. Where the green line is the outcome in the treatment group. Before the treatment (red vertical line), treatment and control groups evolve in the same way, hence we would assume that they also evolve like this after the treatment in the absence of the treatment (dashed blue line). The "treatment effect" is then the difference between the green line and the dashed blue line.
$^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.