A student of mine recently asked me to explain what a musical key was. We sat at his piano and I told him the following main points. Lets start with the key of c major.
First we need to know the major scale. The major scale is C D E F G A B , all the white notes on a piano with no sharps or flats.
Once we know the scale we then build chords on each note. in a major key the pattern is as follows. Major,minor,minor,major,major,minor,diminished.
So the first chord in the key of C is Cmajor. The second is Dminor the 3rd is Eminor etc.
Once we know the chords we can then understand how songs are composed. In its most simplistic form songs are composed using just chords from the key but as music is not an exact science songwriters will pull chords from ‘outside the key'[check out Noel Gallaghers ‘Don’t look back in anger’ The song is in the key of C but he uses the Emajor instead of the Eminor]
The best way to grasp this concept is to write your own songs and to experiment,and above all have fun!