By changing each note by -2, we get the D pitch. As long as we keep the relationship between the notes intact, the melody is the same.
On the guitar I use, D means I don’t have to go too high up on the fretboard. FOr a singer, adjusting the pitch is necessary to make sure it is within the best of range of the vocalist. Have questions?