Two semiconductor materials have different bandgaps, different work functions, electron affinities and dielectric constants. Let's assume they are lattice matched. The larger bandgap material is doped n-type (or N-type) and the smaller doped p-type. In the heterojunction formed epitaxially between the materials there is a discontinuity in the conduction band and a discontinuity in the valence band. This is attributed to the absolute value of the Fermi level in the bulk N-type material being higher than that of the p-type. So a number of electrons must transfer from N to p to equalise the Fermi levels of the two sides and this net charge flow across the interface causes band bending - up for the positive space-charge region in the N-type and down for the negative space-charge region in the p-type. So far so good. I am struggling to reconcile this with the fact that there is band bending but no discontinuity in a homojunction. The Fermi levels of the n- and p-type homojunction material do not line up because they are above and below the intrinsic Fermi level, respectively, so we get net current flow, a depletion region, etc. I have been back and forth between four textbooks looking for satisfaction. Can anybody enlighten me? Thanks.