Do you mean this?
cat lakes.txt | sort > sorted-lakes.txt
That's part of the file name.
As it so happens it is allowed, from
With no FILE, or when FILE is -, read standard input.
But it's optional, and I think it should rather be written in this order:
cat lakes.txt | sort - > sorted
But since reading from stdin is common behaviour for that kind of command, I find it a bit peculiar to add it, it might be there for compatibility or something like that.
But better yet is to write:
sort lakes.txt > sorted