each drive has its own concept of the current directory. CD
changes the current directory, and if you specify a drive letter, it changes the current directory of that drive, rather than (by default) the current drive.
If you want to change the current directory of a different drive, and switch the current drive to that drive also, you use /d
:
CD /d D:\