The circle of fifths is a way to arrange keys to show how closely they are related to each other.
Keys are not considered closely related to each other if they are near each other in the chromatic scale (or on a keyboard). What makes two keys "closely related" is having similar key signatures. So the most closely related key to C major, for example, is A minor, since they have the same key signature (no sharps and no flats). This puts them in the same "slice" of the circle. The next most closely related keys to C major would be G major (or E minor), with one sharp, and F major (or D minor), with only one flat. The keys that are most distant from C major, with six sharps or six flats, are on the opposite side of the circle.
The circle of fifths gets its name from the fact that as you go from one section of the circle to the next, you are going up or down by an interval of a perfect fifth.
If you go up a perfect fifth (clockwise in the circle), you get the key that has one more sharp or one less flat; if you go down a perfect fifth (counterclockwise), you get the key that has one more flat or one less sharp. Since going down by a perfect fifth is the same as going up by a perfect fourth, the counterclockwise direction is sometimes referred to as a "circle of fourths". (Please review inverted intervals if this is confusing.)
The key of D major has two sharps. Using the circle of fifths, we find that the most closely related major keys (one in each direction) are G major, with only one sharp, and A major, with three sharps. The relative minors of all of these keys (B minor, E minor, and F sharp minor) are also closely related to D major.
What are the keys most closely related to E flat major? To A minor?
Name the major and minor keys for each key signature.