Or does it know when its output is being piped to another command, and format its output differently in this case?
Sim. Do manual completo (disponível em info ls
se a documentação estiver instalada):
If standard output is a terminal, the output is in columns (sorted vertically) and control characters are output as question marks; otherwise, the output is listed one per line and control characters are output as-is.
Se você gosta da saída de uma coluna, pode executar
ls -1
para obtê-lo no terminal também.