There are other scales, such as the Dorian mode (1-2-b3-4-5-6-b7 ... scales by contrast feature a b7th interval, or G natural. So the Harmonic Minor’s G# sits perfectly over the E7 chord ...