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 the F#. Try strumming a D or D7 chord and then follow it with a G major.
The F# is there in the D chord, pulling towards the G root. That chord change is known as V-I, because it uses the chords built on the fifth (V) and first (I) notes of the scale.
Back in the early days of harmony, they used that chord change a lot but couldn't get it to work in minor keys. The natural minor (aka Aeolian mode) was the common minor scale and because of its structure, the V-I change sounds weak.
For G natural minor (G, A, B b , C, D, E b , F) you end up with Dm (V) going to Gm (I).
The solution was to raise the seventh note to give the harmonic minor – the notes in G harmonic minor are G, A, B b , C, D, Eb, F#. The V-I is now D-Gm or D7-Gm, (making the V chord a seventh chord, which sounds more 'classical') and we have a cool scale.