
Justin C. answered 05/17/19
Singer, guitarist, songwriter - Stanford B.A. in Music
There are a couple of different things going on here, mostly the use of secondary dominants and mode mixture.
Here's the chord progression:
Intro: I - VI
Verse: I - V/vi - VI/vi - IV/vi (or II)
Bridge: I - V - IV - I - V - IV - bVII - V
Some clever things are happening here, where the composer is actually using G major's parallel minor, E minor, to introduce some fun and colorful chords, while still keeping the overall feel of the song in G major.
Mode mixture is when you borrow a chord from another mode of the same key. For example, the bVII chord in the bridge is borrowed from G Mixolydian (same as G major but with F natural instead of F sharp), which still allows it to have a (albeit weak) dominant function. Also the A major chord in the verse is present in G Lydian (same as G major but with C sharp instead of natural).
Mode mixture also allows you to change a chord from major to minor and vice versa in the progression to add flavor. This is where the E major comes in. Though E major isn't a chord in any of the modes that start on G, it is closely related as the parallel major of E minor, which of course is present in G.
In the simplest terms, you can experiment with changing chords from major to minor and back if they "shouldn't" be that quality in the key that you're working in.
One other thing going on here is the use of secondary functions. The chord analysis above shows that B7 or B serves as the V to vi (E minor) - that's called a secondary dominant. The chord progression briefly goes into E minor before throwing in that A major, which is a nice chord to pivot back to G major on because it's both the mode-mixed(!) IV of E minor AND the mode-mixed II of G major, both of which are subdominant chords in their respective keys.
It's kind of complicated, but I hope that makes sense!