From the manpage:
Code:
There are three major listing formats. The default format
for output directed to a terminal is multi-column with
entries sorted down the columns. The -1 option allows single
column output and -m enables stream output format. In order
to determine output formats for the -C, -x, and -m options,
ls uses an environment variable, COLUMNS, to determine the
number of character positions available on one output line.
If this variable is not set, the terminfo(4) database is
used to determine the number of columns, based on the
environment variable, TERM. If this information cannot be
obtained, 80 columns are assumed.
What you are seeing in your example
> ls | wc -l
> 3
is related to the number of columns that can be displayed.
whap is happening is similar to
> ls -1 | wc -l
> 3
and here, the output was forced to just one column