I do not believe sailors do this on purpose. It just takes two boats who take their eyes off the course for 10-20 seconds (or whatever time interval), and a boat can appear to come out of nowhere. Or just plain poor sailing, risk taking, tiredness.
Whatever you said, regardless of the reason, it is pretty scary. <img src="http://www.catsailor.com/forums/images/graemlins/shocked.gif" alt="" />