Consider a setting with two time periods, $t = 0,1$ and a control $c = 0$ and treatment $c = 1$ group.
Let $T = 1[t = 1]$ be the time dummy and $C = 1[c = 1]$ be the treatment dummy. Then the DiD regressing is given by:
$$
y_{c,t} = \alpha_0 + \alpha_1 T + \alpha_2 C + \alpha_3 T\times C + \varepsilon_{c,t}
$$
If there are unobserved cofounders $z_{c,t}$ then these are part of the error term $\varepsilon_{c,t}$. We can then write:
$$
\varepsilon_{c,t} = \eta_{c,t} + z_{c,t},
$$
where $\eta_{c,t}$ is just noise (e.g. measurement error), so we assume it satisfies the condition $\mathbb{E}[\eta_{c,t}|T,C] = 0$. The DiD estimator is given by:
$$
\mathbb{E}[y_{c,t}|T = 1, C = 1] - \mathbb{E}[y_{c,t}|T = 1, C = 0] -\left(\mathbb{E}[y_{c,t}|T = 0, C = 1] - \mathbb{E}[y_{c,t}|T = 0, C = 0]\right)
$$
Computing this gives:
$$
\begin{align*}
&\alpha_3 +\mathbb{E}[z_{c,t}|T = 1, C = 1] - \mathbb{E}[z_{c,t}|T = 1, C = 0],\\
&-\left(\mathbb{E}[z_{c,t}|T = 0, C = 1] - \mathbb{E}[z_{c,t}|T = 0, C = 0]\right),\\
=&\alpha_3 + \mathbb{E}[z_{11} - z_{0,1} + z_{1,0} - z_{0,0}].
\end{align*}
$$
For identification, we would like this to be equal to $\alpha_3$, which requires that:
$$
\mathbb{E}[z_{1,1} + z_{0,0} - z_{0,1} - z_{1,0}] = 0.
$$
One assumption that will lead to this condition is if cofounders are either time variant but group invariant (i.e. don't depend on $c$) or group variant but time invariant (i.e. don't depend on $c$). Denoting the first by $x_t$ and the second by $y_c$, we can then write:
$$
z_{c,t} = x_c + y_t,
$$
So:
$$
\mathbb{E}[z_{1,1} + z_{0,0} - z_{0,1} - z_{1,0}] = \mathbb{E}[(x_1 + y_1) + (x_0 + y_0) - (x_0 + y_1) - (x_1 + y_0)] = 0.
$$
Which means that $\alpha_3$ is identified using the DiD estimator.