This queries a server's Message Of The Day. Each server is supposed to have an MOTD and your server sent you an MOTD when you connected to it. These messages will tell you about the server you are connected to, and any other information the server administrator wants you to know about.
If a server is given, that server's MOTD is requested. If a nickname is given, that nickname's server's MOTD is requested.
Some networks restrict or limit your ability to do remote server requests. Use of this command may result in an error or may just be outright ignored by the server. Never trust that a remote server request will be answered.
Reading the MOTD (and following the rules) is considered good style.