Just as a compass aligns with the earth's magnetic field, a spinning proton placed near (or within) a large external magnetic field (called Bø) will align with the external field. Unfortunately, it is not quite so simple. At the atomic level, some of the protons align with the field and some actually align against the field cancelling each other out. A slight excess will align with the field so that the net result is an alignment with the external field..
A slight excess number of protons align with Bø.
A Quantum Physics
At 1.5 Tesla, for every 2 million protons, there are 9 more protons aligned with the field than there are aligned against the field.
A complete explanation of why the protons align both with and against the external magnetic field would require a study of quantum mechanics. Suffice it to say that both alignments are possible, but the one with the field is a lower energy state. The protons are continually oscillating back and forth between the two states but at any given instant, and with a large enough sample, there will be a very slight majority aligned with the field. The larger the external Bø field, the greater the difference in energy levels and the larger the excess number aligned with the field.