Why does `xargs` not work with `echo` but work with `ls`?

echo "z1 z2" is producing a single-line string:

z1 z2

ls is producing two lines:

z1
z2

You can replicate its behavior with echo -e, which will print \n as newlines:

$ echo -e "z1\nz2" | xargs -I{} cat {}
abc
xyz