question on redirection (<<)

I came across the following problem, where file contents are overwritten using redirection. Can somebody please explain what cat << BAR seems to be doing and say why this is a problem? Explain the contents and relation between the two filenames used before the cat command. thanks

/tmp# echo 'hello world' > rootfile
/tmp# chmod 600 rootfile
/tmp# ln -s rootfile sh$$
/tmp# chown -h 666.666 sh$$
/tmp# ls -l rootfile sh$$
-rw------- 1 root root 12 Oct 29 03:55 rootfile
lrwxrwxrwx 1 666 666 8 Oct 29 03:56 sh12660 -> rootfile
/tmp# cat <<BAR
? FOO
? BAR
FOO
o world
/tmp# ls -l rootfile sh$$
/bin/ls: sh12660: No such file or directory
-rw------- 1 root root 12 Oct 29 03:56 rootfile
/tmp# cat rootfile
FOO
o world
/tmp#

I've been looking at this and I don't understand cat << BAR myself. I've done some testing using this construct and it fails. I get nothing out of trying this. Where is BAR coming from anyways? Here is the rest

/tmp# echo 'hello world' > rootfile #print the string 'hello world into a new file called rootfile
/tmp# chmod 600 rootfile # change the perms to be -rw-------(Read and write by the owner only)
/tmp# ln -s rootfile sh$$ #Create a symbolic link. $$ means session id number. So link sh$$ with rootfile. If I vi sh$$ it's the same as doing a vi rootfile because they are linked.
/tmp# chown -h 666.666 sh$$ # -h means change if it's a symbolic link which it is. The uid and gid are being changed to 666
/tmp# ls -l rootfile sh$$ #Do a long list of both files
-rw------- 1 root root 12 Oct 29 03:55 rootfile
lrwxrwxrwx 1 666 666 8 Oct 29 03:56 sh12660 -> rootfile
/tmp# cat <<BAR # Have no idea, where is BAR coming from?
? FOO
? BAR
FOO
o world
/tmp# ls -l rootfile sh$$ # Do a long list of both files again, yet the link file is now missing after running the cat <<BAR command.
/bin/ls: sh12660: No such file or directory
-rw------- 1 root root 12 Oct 29 03:56 rootfile
/tmp# cat rootfile #Show contents of rootfile.
FOO
o world
/tmp#

Wish I could be more helpful.

-X

I'm with Xriley it doesn't make a lot of sense to either-

I think the original script was trying to use a here doc - that's the only valid use of <<
example:

# feeding answers to a program's stdin that asks three questions:
./myprogram <<BAR
answer1
answer2
answer3
BAR

"BAR" delimits the end of the here doc. That's my take on it anyway.