man 3 ls will only show you a man page for
ls in section 3 of the manual. Section 3 covers library functions; since there's (probably) no library function named
ls, it won't find anything.
man command without a section number searches the sections in a predefined order that I don't remember, but it's likely to be close to numerical order starting at 1. So
man ls will find the
ls man page in section 1, which covers user commands.
The sections (on my Ubuntu system) are:
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
Specifying the section can be useful for things that exist with the same name in more than one section. For example,
man printf will show you the man page for the
printf user command in section 1; to see the man page for the
printf function, use
man 3 printf. You'll often see these man pages referred to as
Stealing Borrowing from abernert's answer, it's common to see a user command (section 1) that's a wrapper for a system call (section 2) or library call (section 3) with the same name;
chmod are good examples of this.