A solar cell is made of two types of semiconductors, called p-type and n-type silicon ... now contains negatively charged ions, and the n-type side of the depletion zone (where electrons were present) ...
For decades semiconductors have formed ... on the p-type side and positive charge on the n-type side occurs in a narrow region, called the charge depletion zone, and generates an electric field ...
The PN junction is one of the primary building blocks of semiconductors ... and overcomes the depletion zone, causing the current to flow from the p-type to the n-type side.