It depends on how detailed you'd like me to get.
In short: due to quantum physics.
Each orbital is a cloud of space representing the probabilistic location of two electrons. One of these electrons generally spins "up" and the other generally spins "down".
In the presence of a magnetic field, these up- and down-spin electrons exhibit characteristic energy.
Other subatomic particles have these spins, as well. When chemists draw orbital shorthand, they generally fill in the