Modes and Pentachord.
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 one and was called the mode of god. Now, 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.
Here is below, in ancient Greece, the idea behind the Pentachord and Modes. Penta (from Greek "five of something" and chord (chordon - "string"). The picture below, with the black dots, "explains" the principle of an instrument with five strings. Three full tones and one halftone.
Now, let’s have a look at the picture below, Modes in C major. Please also note, that the Modes we know today, come from around 14th century.
We have all the modes in C major: C Ionian, D Dorian, E Phrygian, F Lydian, G Mixolydian, A Aeolian, B Locrian. 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 the Ionian mode, from D to D the Dorian mode, from G to G the Mixolydian mode and so on. It is a matter of 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, thus one has to be careful when playing in C. Effectively, G but most of all G7, which has the Triton and G mixolydian fits well when playing a G7 chord.
To better understand that shift, see the example below: