And again, don't ever trust people who trot out "for a progression of Amin7 to D7 to G use A Dorian, then D Mixolydian, then G Ionian". That TOTALLY obfuscates the fact that those three chords DEFINE a G major key center and using the G major scale is the what ties them together....
100% correct of course, AND understanding harmony and what modes are allows you to know and hear the obfuscated fact of what the key center is, so you don't need to ask JTE to work it out for you for each chart...
So expanding on John's example, if you have a ii-V progression such as Amin7 (ii) to D7 (V), the key center is G major (I).
What that means is that you can riff/walk within the G major scale over those ii-V changes and you will be diatonic. Try it out and hear it for yourself.
But you won't know that unless you understand the major scale, it's intervals, and how the modes are constructed from that.