If you pretend the song is in g-minor (which has a B-flat) those chords make a lot more sense: Eb becomes the bVI chord (super common in minor-key songs), and Bb becomes the bIII (also pretty common — what’s known as the relative major of g-minor). The Eb also serves the function of IV / bIII here — basically it just acts like a pivot between the original g key and its relative major (Bb); note that Eb is the bVI chord in the key of g minor, but also the IV chord in the key of Bb. D7 would be the V chord in G major or minor, so it doesn’t sound especially out of place like the others do, and leads the progression nicely back to G.
The reason the middle two chords sound especially interesting here is that the song is not in g minor — instead of having that flatted third in the chord (i.e. Bb) it has the major third (B natural), which creates a neat half-step dissonance when played next to chords that do have it flatted (like Eb and Bb). G minor has its own chords separate from those of G major due to how a g minor scale is constructed; borrowing from a key’s parallel major/minor can yield some really interesting chord progressions/sounds (such as the ones you’ve found here).
My theory is a bit rusty, so hopefully that all is accurate and makes sense!