A key describes which root a piece organises itself around and which notes “fit” with it. Those fitting notes come from a scale.
A scale is a fixed sequence of notes within an octave, ascending from the root to its repetition an octave higher. A common scale has seven different notes (degrees) before the root repeats at the top. It defines the pool of notes from which the melodies and chords of a key are formed – key and scale are thus two views of the same thing: the key as the centre, the scale as the sequence of notes that spans this centre.
What matters here is not the absolute pitch, but the pattern of whole and half steps between the notes. It is exactly this pattern that determines the characteristic sound and is the same for every key: shift the root and the whole pattern moves with it – the relationships between the notes stay identical.
The two most important patterns are major (bright and resolved) and minor (darker and softer). They differ above all in the third, but also in the sixth and seventh. Below you can switch between the two and compare the step sequence, the degrees and the intervals step by step.
Switch between major and minor below and watch how the third, sixth and seventh shift.