If you leave off the trailing slash, it can point to a file or a directory. If you include the trailing slash it can only
point to a directory. This can be advantageous in certain cases. For example, say you want to copy A (a file) into B (a directory).
You could use either
If B already exists and is a directory, the two commands are interchangeable, but if B doesn't already exist, or if it does already exist and is a file, the behavior will be quite different.
The former command will just copy the file A to the file B, overwriting its previous contents if necessary.
The latter command will ONLY do anything if B already exists and is a directory. If B doesn't exist or if B is a file, the latter command will throw an error, allowing you to correct the command before accidentally overwriting the file B or creating copies of A where you don't want them.
For that reason, when I'm referring to a directory, I always put a trailing slash on the end so that if I make a mistake in the name it will throw an error rather doing something I don't want it to do.