Concept of Fermi Level:
In simple term, the Fermi level signify the probability of occupation of energy levels in conduction band and valence band.
In extrinsic semiconductors, the number of electrons in the conduction band and the number of holes in the valence band are not equal. Thus, the probability of occupation of energy levels in conduction band and valence band are not equal. Therefore, the Fermi level for the n type semiconductor lies close to the conduction band and for p type semiconductors it lies close to the valence band. You can see the following example, this is example of n type semiconductor, where Fermi level lies close to conduction band,
In p type semiconductor, it lies close to valence band because holes are majority.
This is the concept of Fermi level in semiconductors.
In case of any doubt, please mention in comment section.