Here's a simplified tale of music theory. The seventh note of a major scale is very powerful. In G major the notes are G, A, B, C, D, E, F#, so we're talking about ...
Harmonic minor keys are used when writing chords. There is another version of the minor key known as the melodic minor. This is used when writing a melody. Each key signature has two possible keys.