Modes are named after the ancient Greek modes. originally there were four of them. D mode, E mode, F mode, and G mode. They have been used until the 18th century in church music and Gregorian music. D mode was the main mode and was called the mode of god. Now, from the middle aged, there are seven of them, one for each note of a scale. The first note of a scale, called Tonic, gives not only the name of the scale but also the type of mode involved, while the intervals between the notes determine the type of scale, major, minor, diminished.
Let’s have a look at the picture, Modes in C major, below.
We have all the modes in C major: C Ionian, D Dorian, E Phrygian, F Lydian, G Mixolydian, A Aeolian, B Locrian.
As one can see, the interval between each note is exactly the same now matter the note. Very often, one takes the image of a white keys of a piano played from C to C, to D to D and so on. The whites keys from C to C give Ionian mode, from D to D the Dorian mode, from G to G the Mixolydian mode and so on. It is a matter of ht shift. See more in detail the Comparison Mode picture Below. You will notice the right shift among the notes. So, what it is crucial here to understand is the result of that shift. In C Ionian, we have the a major Third, (c,e,g). However, in D Dorian it a minor Third (f,a,c). This is the "purpose" of the modes. It is to give to each mode its own coloration. If you analyze all the modes in C (the root key), you will easy see that the A Aeolian mode is minor and is called relative minor of C major. That’s particularly interesting when improvising. You’ll have then a different and yet complementary mode at your disposal. This applies in all keys. For instance, in G major, you have E Aeolian (minor).
Now, the function of the chords is also important to mention. In C major, G is the dominant chord, so one has to be careful when playing in C. Effectively, G but most of all G7, has the Triton and in my view, G mixolydian fits well when playing a G7 chord.
To better understand that shift, see the example below: D note, the first note in Dorian, starting under the second note of C Ionian.