A common structure for LEDs the ppin-junction,
[p-layer][p electron blocking layer][i layer][n layer]
The p-layer, i-layer and n-layer is just your standard pin-junction structure. The p and n layers provide an electric field, which under forward bias will drive electron and hole towards i-layer where they can recombine radiatively. Normally the p and n layers will be made of a higher band gap material (e.g. AlGaAs) and form a barrier around the lower band gap i-layer (e.g. GaAs). This helps the i-layer act as a radiative recombination centre to improve efficiency.
However, it is possible for electrons and holes to pass over the i-region without recombining radiative, in LEDs this is loss mechanism. Electrons are much more mobile than holes (by about an order of magnitude), so if we can prevent electrons from escaping we should be able to improve the efficiency of the LED (i.e. the electrons are the rate limiting carrier type). This is the role of the second p-layer or electron blocking layer.
If the electron blocking layer has a wider band gap (so AlGaAs with a higher Al fraction than the n and p layers), and has more p-dopant, then it is possible to align the valence band with the p-layer (obviously there is a space charge at the hetero-interface where the bands are not flat). This gives a large barrier only in the conduction band which prevents electrons from crossing the junction (and escaping) but does not restrict the hole current flow, thus improving the device efficiency. So this is why ppn or ppin structures are used in practice. It's an optimisation.