For a basic explanation about exchange energy I would refer to "what is the exchange energy of electrons?". So I think you should realise that the exchange interaction might be a little misleading term as it implies electrons hop from one orbital to another gaining some energy in the process. But in reality it is a little more difficult. In essense it is the antisymitrization of the total wavefunction of the electrons that result in the electrons being on average closer together when they have opposite spin resulting in more repulsion hence a higher energy or farther from each otherhas when heaving same spin which lead to lower energies.
A more involved explanation would be to consider the example of a two electron wave function $$\Psi(x_1,s_1,x_2,s_2)= \psi(x_1,x_2)\chi(s_1,s_2)$$
where $\psi(x_1,x_2)$ is the spatial wavefunction of the electrons and $\chi(s_1,s_2)$ the spin wavefunction of electrons 1 and 2. As the total wave function needs to be antisymetric under exchange of the electrons (which means that if you swap $x_1\leftrightarrow x_2$ and $s_1\leftrightarrow s_2$ in the total wavefunction $\Psi$ syou would obtain the same wavefunction but with an extra minus sign $-\Psi$). This requirement is a result from the so called "Spin-statistics theorem" which is a quite advanced theory in quantum physics so for this discussion it's better to accept that fact.
Let's take two spatial orbitals $\psi_a$ and $\psi_b$ as basis for the combined electron spatial orbital $\psi$. We construct a spatially symmetric $+$ and anti-symmetric wavefunction $-$ as
$$\psi_+ = \frac{1}{\sqrt{2}}(\psi_a(x_1)\psi_b(x_2) + \psi_b(x_1)\psi_a(x_2))$$
and
$$\psi_- = \frac{1}{\sqrt{2}}(\psi_a(x_1)\psi_b(x_2) - \psi_b(x_1)\psi_a(x_2))$$
you can check yourself that $\psi_-$ is antisymetric when swapping $x_1\leftrightarrow x_2$. Calculating the expectation value of the square of the separation between the two electrons $\langle (x_1-x_2)^2\rangle\equiv \langle (\Delta x)^2\rangle$ for the symmetric (+) and antisymmetric (-) case result in
$$ \langle (\Delta x)^2\rangle_\pm = \langle (\Delta x)^2\rangle_d \mp 2|\langle x\rangle |^2$$ where $ \langle (\Delta x)^2\rangle_d $ is the square of the separation distance if the particles where distinguisable and thus no exchange possible (for example if the electrons had different colours such that you could distinguish one from the other, which they have not in reality). And thus the difference is in the second term (which is called the exchange integral). The main take away from this calculation is the sign of the second term. For symetric spatial wave functions the electrons are somewhat closer together then the distinguisble particle case and for anti-symetric spatial wave functions the electrons are a further appart.
Realizing that the closer the electrons are together the larger the repulsion and thus the higher the energy of the state we see that for a symmetric wave function we expect a higher energy then for an antisymmetric wavefunction. This is the exchange energy.
In the last step we should couple the spatial and the spin together. You might have wondered why we would care about the symmetric spatial wavefunction in the first place as the total wave function of the electrons must be anti-symmetric. However, if we include the spin wavefunction that can also be (anti-)symmetric we can have the following possibilities for a anti-symmetric total wave function: $\Psi_- = \psi_{-}\chi_+$ or $\Psi_- = \psi_{+}\chi_-$ (so not $\Psi_+ = \psi_{+}\chi_+$ or $\Psi_- = \psi_{-}\chi_-$).
Hence when electrons have "the same spin" which generally means that they have a symmetric spin wave function, the spatial wave function must be anti-symetric and the electrons lie a bit further appart meaning less repulsion and a lower energy. Similarly when the electrons have "opposite spin" which then would mean they have an anti-symetric spin wave function. They must have a symetric spatial wave function leading and electrons are a little bit closer together meaning more repulsion and a higher energy.