In a piece of music, modulation refers to the transition from one key to another. There are different techniques to achieve this.
For example, a chord which both keys have in common can be used for the transition; this is called diatonic1) modulation. The chord occurring in the first key is reinterpreted as a chord in the target key. The subdominant (= 4th note) or the subdominant parallel (= 2nd note) of the new key are particularly popular.
The dominant seventh chords can be reinterpreted as the dominant chords of their highest note (the seventh).
By increasing or decreasing (altering) a tone by one semitone step, it can become a transition to another key.