Let's talk about what happens when two materials are brought into contact:
The Fermi level is a measure of the energy you add or remove from a system by adding or removing an electron (i.e. electrochemical potential). For any two materials you arbitrarily select, they are likely to have different Fermi Levels : The energy change to the system for adding or removing an electron in one material will be different than the energy change to the system for adding or removing an electron in the other material.
When you place two non-identical materials in contact with each other, things that are able to move around from one material to the other (like electrons) will do so because of entropy.
Two cases are possible:
1) When an electron leaves material A and enters material B, the INCREASE in the energy of material B (because you have added an electron and thus energy to material B) is LESS than the DECREASE in energy of material A you got for removing that electron. In this case, the energy of the overall system is reduced by an electron diffusing from material A into material B, and thus it ~will happen spontaneously
2) When an electron leaves material A and enters material B, the INCREASE in the energy of material B (because you have added an electron and thus energy to material B) is MORE than the DECREASE in energy of material A you got for removing that electron. In this case, the energy of the overall system is increased by an electron diffusing from material A into material B, and thus this process will ~not happen spontaneously.
So: If you put two random materials in contact with one another, things that can flow from one material to the other will do so, and they will do so in a direction (A->B, or B->A) that lowers the entire system's overall energy.
Now, it is important to think about what else is happening when these charges are diffusing from one material into the next. Originally, both materials were electrically neutral: each material was created an equal number of electrons and protons. A medium that is (on average) electrically neutral will have no electric field inside of it. This whole situation changes when you place material A and B in contact with each other. As we have already stated: electrons will flow from one material to the other, and that means charge is being transferred from one material to the next.
When electrons leave material A and go into material B, a net negative charge accumulates in material B and a net positive material accumulates in material A. Every electron that transfers from material A to material B increases this charge difference. This is important, whenever you create regions of net negative or positive charge you create a region of electric field. Because the charge is transferred between the two materials as the interface between these two materials, the electric field is also present at this interface. An electric field is (defined as) the Force on a charge. So, now you have charges transferring from material A into material B, but every time that happens you also have an electric field at that interface (between the two materials) get stronger and stronger. The electric field actually applies a force to all charges near the interface in the following direction: from material B TO material A. You should note that this force goes AGAINST the natural tendency of electrons to diffuse from material A into material B. This is important because now there are two big energy considerations to take account of when thinking about charges moving between the materials:
1) The electrochemical difference between adding an electron to material A and material B (we considered this earlier).
2) The energy required to move an electron THROUGH this (growing) electric field present at the interface between the two materials.
The first consideration is a reason for charge to transfer from one material to the next. The second consideration acts AGAINST the natural tendency of charge flow (as described by the first consideration). When the energy to go THROUGH the electric field at the interface (consideration two) is equal to the lowering of energy the system achieves by moving an electron from a material with higher electrochemical potential to lower electrochemical potential (consideration one), no more (net) electrons can travel across interface.
With this description in hand, let's return to your original question about vacuum level shifting. In physics we use the vacuum level as a sort of universal reference point. We often speak about how much energy it takes to grab an electron from within a material and throw it out to the vacuum level, idealized as a point in space that is infinitely far away from the material. To remove an electron from a material, you must give it enough energy to leave whatever bond is holding it and then move it through the material to the interface of the material, and then extract the electron from the interface of the material and pull it out to vacuum. I use the word pull here because there will be a force pulling the electron back into the material: the electron has a charge and when you removed it for the material you created (for various reasons) an opposite charge (to the electron) in the material. These two opposite charges will have an electric field pulling them together and you must overcome that force and pull the electron away from the material (to ~infinity).
So, when you look at a band diagram of material A and see vacuum level at the top, you are seeing a quantification (relative to the energy of other things on the diagram) of how much energy it takes to grab an electron from inside material A, pull it out of material A and pull it all the way out to infinite distance. As I have mentioned, the quantity of energy to do this takes into account the amount of energy you need to overcome some electric field (created between the electron you grabbed from inside the material and an opposite charge that resides inside the material) pulling the electron back to the surface.
Remember, quantification of vacuum energy has 2 parts: 1) the energy required to free an electron from its bond within the material and 2) the energy required to pull an electron out of the material and to infinity. Now, let's see what happens if you apply this vacuum level concept to an electron that is INSIDE that interface region we created between material A and material B, where there is ALREADY an electric field.
The amount of energy required to free an electron from its bond may be the same as it was before, but now the electric field that is pulling the electron back into the material is much stronger than in a region away from the interface. If you add together the two quantities (bond energy to electric field energy) for the vacuum level you will see that it can change widely within this interface region.
To first approximation, this is the reason you see the vacuum level shifting in the interface region of materials A and B on a band diagram.
I don't know what you call vacuum level, but the equilibrium requires alignment of the electrochemical potentials aka as Fermi levels. That brings about the shifts.
In most cases vacuum level just change its position in diagram but the ' value' it presents never changes because it is kind of base line we use to compare different energy levels . When the Schottky junction is formed, the work function of the semiconductor will keep the same as the previous but we need to do the fermi level alignment in the band structure diagram. As the fermi level is shifted by us, the vacuum level also shifts to keep the work function unchanged.
There are two types of vacuum levels related to any samples; (1) Vacuum level just out side the surface of the sample, where the electrons are at rest just out side the sample typically used to define the work function of a metallic sample and(2) Vacuum level away from the samples at infinity, where the electrons are at rest away from the sample.
The first one depends on the dipole formation at the surface (spilling of electrons outside the top most layer) and depends on the electronic, atomic and chemical structures of the sample. Any changes or perturbations to the electrons on the top most layer of the samples, such as the formation of a junction or an interface, this vacuum level will change contributing to the change in the workfunction of the material along with the contribution of aligning the fermi level as discussed by Igor and Chang above.
Check the reference below for detailed information.
Article Cahen, D. & Kahn, A. Electron energetics at surfaces and int...
Also, please note that the band diagrams are often drawn for only 1 spatial dimension (typically looking at the direction perpendicular to the interface).
Let's talk about what happens when two materials are brought into contact:
The Fermi level is a measure of the energy you add or remove from a system by adding or removing an electron (i.e. electrochemical potential). For any two materials you arbitrarily select, they are likely to have different Fermi Levels : The energy change to the system for adding or removing an electron in one material will be different than the energy change to the system for adding or removing an electron in the other material.
When you place two non-identical materials in contact with each other, things that are able to move around from one material to the other (like electrons) will do so because of entropy.
Two cases are possible:
1) When an electron leaves material A and enters material B, the INCREASE in the energy of material B (because you have added an electron and thus energy to material B) is LESS than the DECREASE in energy of material A you got for removing that electron. In this case, the energy of the overall system is reduced by an electron diffusing from material A into material B, and thus it ~will happen spontaneously
2) When an electron leaves material A and enters material B, the INCREASE in the energy of material B (because you have added an electron and thus energy to material B) is MORE than the DECREASE in energy of material A you got for removing that electron. In this case, the energy of the overall system is increased by an electron diffusing from material A into material B, and thus this process will ~not happen spontaneously.
So: If you put two random materials in contact with one another, things that can flow from one material to the other will do so, and they will do so in a direction (A->B, or B->A) that lowers the entire system's overall energy.
Now, it is important to think about what else is happening when these charges are diffusing from one material into the next. Originally, both materials were electrically neutral: each material was created an equal number of electrons and protons. A medium that is (on average) electrically neutral will have no electric field inside of it. This whole situation changes when you place material A and B in contact with each other. As we have already stated: electrons will flow from one material to the other, and that means charge is being transferred from one material to the next.
When electrons leave material A and go into material B, a net negative charge accumulates in material B and a net positive material accumulates in material A. Every electron that transfers from material A to material B increases this charge difference. This is important, whenever you create regions of net negative or positive charge you create a region of electric field. Because the charge is transferred between the two materials as the interface between these two materials, the electric field is also present at this interface. An electric field is (defined as) the Force on a charge. So, now you have charges transferring from material A into material B, but every time that happens you also have an electric field at that interface (between the two materials) get stronger and stronger. The electric field actually applies a force to all charges near the interface in the following direction: from material B TO material A. You should note that this force goes AGAINST the natural tendency of electrons to diffuse from material A into material B. This is important because now there are two big energy considerations to take account of when thinking about charges moving between the materials:
1) The electrochemical difference between adding an electron to material A and material B (we considered this earlier).
2) The energy required to move an electron THROUGH this (growing) electric field present at the interface between the two materials.
The first consideration is a reason for charge to transfer from one material to the next. The second consideration acts AGAINST the natural tendency of charge flow (as described by the first consideration). When the energy to go THROUGH the electric field at the interface (consideration two) is equal to the lowering of energy the system achieves by moving an electron from a material with higher electrochemical potential to lower electrochemical potential (consideration one), no more (net) electrons can travel across interface.
With this description in hand, let's return to your original question about vacuum level shifting. In physics we use the vacuum level as a sort of universal reference point. We often speak about how much energy it takes to grab an electron from within a material and throw it out to the vacuum level, idealized as a point in space that is infinitely far away from the material. To remove an electron from a material, you must give it enough energy to leave whatever bond is holding it and then move it through the material to the interface of the material, and then extract the electron from the interface of the material and pull it out to vacuum. I use the word pull here because there will be a force pulling the electron back into the material: the electron has a charge and when you removed it for the material you created (for various reasons) an opposite charge (to the electron) in the material. These two opposite charges will have an electric field pulling them together and you must overcome that force and pull the electron away from the material (to ~infinity).
So, when you look at a band diagram of material A and see vacuum level at the top, you are seeing a quantification (relative to the energy of other things on the diagram) of how much energy it takes to grab an electron from inside material A, pull it out of material A and pull it all the way out to infinite distance. As I have mentioned, the quantity of energy to do this takes into account the amount of energy you need to overcome some electric field (created between the electron you grabbed from inside the material and an opposite charge that resides inside the material) pulling the electron back to the surface.
Remember, quantification of vacuum energy has 2 parts: 1) the energy required to free an electron from its bond within the material and 2) the energy required to pull an electron out of the material and to infinity. Now, let's see what happens if you apply this vacuum level concept to an electron that is INSIDE that interface region we created between material A and material B, where there is ALREADY an electric field.
The amount of energy required to free an electron from its bond may be the same as it was before, but now the electric field that is pulling the electron back into the material is much stronger than in a region away from the interface. If you add together the two quantities (bond energy to electric field energy) for the vacuum level you will see that it can change widely within this interface region.
To first approximation, this is the reason you see the vacuum level shifting in the interface region of materials A and B on a band diagram.