is relative to A minor (also with no key signature). Follow this process through and E major (4 sharps) is relative to C# minor. Bb major (2 flats) on the other hand, is relative to G minor.
This is known as the relative minor. So G major, for example has a key signature of one sharp, but this is also the key signature for E minor. To find this, just count down three semitones (count ...