That comes from one of the rules that state that any step in a progression can be preceded by a note one half step from above or one half step below.
Music is like an abstract math. Good thing I love math.
NOTE: This is one of the most basic rules. Also, there are so many rules that combining them will allow you to practically do anything while you're playing. To start learning theory, like this, you have to first learn the major scale in all keys. This allow you to learn the 1s, the 4s, the 5s, etc, of each key. Once you learn that, you'll be able to comprehend the what people mean when they say something like "2-5-1" or "7-3-6". It'll also enable you to learn songs faster, because you'll be able to understand the patterns.