i've been trying to get my head around roughly how nMOS's work, this diagram has really been confusing me:
Now from what i understand, at first electrons cannot flow from source to drain due to the depletion layer that is formed, effectively creating a diode that is reverse biased. When turning the gate on, it attracts the electrons near the gate's electric field, shrinking the depletion layer and creating a channel which electrons can flow. However, what does not make sense to me is that if a voltage is applied to the gate won't it be negatively charged? Therefore repelling electrons? I feel like i'm missing something obvious.