In Angrist & Pischke's book mostly harmless econometrics, they explain that if the treatment in an RCT $D_i$ is randomly assigned, then $D_i$ is independent of potential outcomes and the following holds:
$$ \begin{align} E[Y_i|D_i = 1] - E[Y_i|D_i = 0] &= E[Y_{1i}|D_i = 1] \color{red}{- E[Y_{0i}|D_i = 0]} \\\\ &= E[Y_{1i}|D_i = 1] \color{red}{- E[Y_{0i}|D_i = 1]} \end{align} $$.
The main thing here, as I understand it, is that we can switch the terms in red $E[Y_{0i}|D_i = 0]$ $E[Y_{0i}|D_i = 1]$. But How do I interpret this? I get why we want to randomly assign treatment (because we want the treatment group and control group to be identical), but I don't understand what the above equation says. For me it looks like the expected outcome for the control group is the same even if they get treatment, i.e, $D_i = 1$. I think I am misinterpreting something here.
For completeness. After this, they go on to say that we can simplify further. Starting from the last line above:
$$ \begin{align} E[Y_{1i}|D_i = 1] - E[Y_{0i}|D_i = 1] &= E[Y_{1i} - Y_{0i} | D_i = 1] \\\\ &= E[Y_{1i} - Y_{0i}] \end{align} $$, noting that "The main thing, however, is that random assignment of $D_i$ eliminates selection bias".
Let me know if I need to add some context!