It has to do with how the parties involved interpret it. Between friends I have said the same things, but not everyone will be comfortable with these things said to them and can even interpret them maliciously. They can be seen as workplace harassment for this reason.