Also how ls
command behaves is mentioned here:
If standard output is a terminal, the output is in columns (sortedvertically) and control characters are output as question marks;otherwise, the output is listed one per line and control charactersare output as-is.
Now you see why redirecting or piping outputs one per line.