The P-N junction is made from a single crystal with the impurities diffused into it.
The N end has a surplus of negative electrons. The P end has a surplus of holes.