# Connecting Fermi levels and band diagrams to potential diagrams?

I'm trying to make sense of how you can find the potential diagram given the band diagrams of a few adjacent materials.

As a simple example, in semiconducting heterostructures, if you have sandwich of a type 1 junction, you get a finite barrier (or well) that has the height (or depth) of the the difference between the conduction band energies of the two materials, $\Delta E_c = E_{c1} - E_{c2}$.

That makes a little sense to me, if an electron in the (let's say surrounding, so it's a barrier) lower conduction band energy material wants to move to/through the higher one, electrons in that band have a higher energy so it makes sense that it'd need more energy to pass through it.

But why don't electrons from the higher energy material just go to the lower one, until the resulting buildup of charge makes their potential equal? This happens if you make two metals touch each other, where surface charges build up and make an electrostatic potential across the boundary to make the electrochemical potential in the two materials equal.

My other question I'm having more trouble with is, how do you analytically guess what would happen with an insulator and a metal? Is the potential just the difference between the Fermi energy of the metal and the conduction band energy of the insulator?

Thank you!

If $E_{f1}>E_{f2}$, your concerning case, electrons move from 1 to 2 regardless of the other parameters. The migration of electrons make the charge distribution and the electron potential change. To calculate the charge distribution, we assume charge neutrality in places away from the interface and the existence of the depletion layer. We also assume that changes of charge distribution just shift the (eigen-)energies of electrons via the electronic potential obeying the Poisson equation.
I answer the 2nd question in the affirmative. We can confirm this by using similar method mentioned above. For example, in case of metal-n junction with $E^{metal}_f$ inside the bandgap, the notable Schottky barrier is formed.