To answer the original question, */
has nothing to do with ls
per se; it is done by the shell/Bash, in a process known as globbing.
This is why echo */
and ls -d */
output the same elements. (The -d
flag makes ls
output the directory names and not contents of the directories.)