Since the Baroque period, collections of preludes and fugues have served not only as pedagogical tools, but as ideological demonstrations of Western fundamental harmony.
J. S. Bach first demonstrated to the aural world the benefits of well-tempered tuning through his series of preludes and fugues set in every single key. The circle of fifths, upon which Western fundamental harmony is based, is not a true circle, because one never really returns to the "home" note but keeps progressing infinitely, unless minor modifications are made in some of the pitches.
Well-tempered tuning makes these adjustments, allowing the keyboardist to go from one key to another quite easily, without having to retune the instrument every time he or she does so. Bach's collection of 24 preludes and fugues (one prelude and fugue for every major and minor key) set a pedagogical and ideological standard that later generations of composers have followed.
In the 19th century, Chopin composed a set of 24 preludes, and more recently, Shostakovich compiled his own set of 24 preludes and fugues. Unlike Bach's set, which is arranged by chromatic progression up the keyboard (C major, c minor, C# major, c# minor, etc.), Shostakovich's own collection is arranged according to the circle of fifths and relative key signatures, further emphasizing the mathematical relationships within Western fundamental harmony.
His first prelude/fugue pair is set in C major, followed by the relative minor, a (the minor key that shares the same key signature as C major). The next pair goes up five notes in the Western major scale to G major, and the following prelude/fugue pair is set in the relative key of e minor.
This progression up five notes in the scale (with the corresponding relative key) continues until every key has been played. Since the keyboard is tuned with the well-tempered system, the full progression returns the keyboardist to the starting key in a metaphorical circle.
Shostakovich greatly admired the work of Bach, and quotes several Bach themes in his prelude/fugue set. However, Shostakovich also infused his own 20th century Romantic style into the sound of his music, distinguishing this 20th century production from the precedent established by Shostakovich's musical hero.