Just as < is used as the standard input, > is used as the standard output redirection.
cat fileusually displays the results on the terminal screen.
By concatenating > outfile to the command, as in
cat file > outfilethe output will be redirected to outfile. If outfile did not exist, it is created. If it does exist, the previous contents are lost, and replaced with the new output!!
This problem can be avoided by using >>:
cat file >> outfilewhere file will be appended to outfile.