Scales are the ordered collections of pitches that give a passage of music its tonal flavor. Understanding how scales are built, how key signatures encode them, and how major and minor differ is essential for both analysis and composition.
A scale is defined by its pattern of intervals. The major scale follows the sequence tone–tone–semitone–tone–tone–tone–semitone (T–T–S–T–T–T–S). Starting on C and following this pattern uses only the white keys of the piano, which is why C major has no sharps or flats. Start the same pattern on G and you must raise the seventh note to F♯ to keep the intervals correct; start on F and you must lower the fourth to B♭. This is why every major key except C requires accidentals, and why those accidentals appear predictably.