What does the command “$ls | wc –l > file1” do?

ls becomes the input to wc which counts the number of lines it receives as input and instead of displaying this count , the value is stored in file1.