PV cells have layers.
The top layer is made of glass meant to let in the sun’s rays, while the bottom layer is made of a protective material to make sure the inside components don’t get damaged.
Inside the PV cell, there are three layers. When photons hit the PV cell, electrons are knocked loose and travel to the top silicon layer. This creates a buildup of electrons in the top layer, giving it a negative charge while the bottom layer gains a positive charge.
Because of this, the top layer is called the “n-layer,” n meaning negative, while the bottom layer is called the “p-layer,” p meaning positive.
The middle layer, or the “p-n junction”, ensures the n and p layers stay separate and keep their charges. Because the n and p layers have different charges, this creates an electrical voltage, which can be used in a circuit to power an external load, like a lightbulb.