Some of my pupils must be sick of hearing me ask this recently...
Here's a different question: what does a key signature tell us? "It tells us what key a piece is in", or "It tells us what our key note is". Right? Well, yes and no. Each key signature corresponds to one major and one minor key, that much is correct.
But what if a piece isn't in a major or minor key? Greensleeves, Scarborough Fair, What Shall We Do With The Drunken Sailor - none of them quite follow the right patterns. If we write out Scarborough Fair with a home note of D, we find ourselves not using any accidentals at all, and a key signature of no sharps or flats works just fine. (Owners of Fiddle Time Scales 2 can check this out.) The tune isn't in C major, nor A minor, so what's going on?
What does a key signature really tell us?
Key signatures tell us where the semitones are.
The sheet below shows all the different modes, according to their common modern definitions. (The Wikipedia article also goes into some detail regarding historical definitions, too.) The 'Ionian mode', the second one down, is familiar as a major scale. By altering one note by a semitone, we can shift up or down the page to the next mode.
Now look at the key signatures. These are all scales on D, but they've all got different key signatures. So in this situation, the key signature isn't telling us our home note, but between which notes the semitone are to be placed. Try working through these scales, and aim to really feel the shifting semitones affecting the character of the modes, in the way they give individual notes a certain 'gravity' towards their neighbours.
(I owe a debt to David Fallows, my professor when I was at university, for setting me thinking along these lines. He pointed out that in medieval music notation, the real function of the movable clefs isn't to tell us which note is on which line, but to tell us where the semitones lie. Thankfully we don't have to worry about anything other than the treble clef with the modern violin!)