To me, there's a very fine line and a lot of it is down to the delivery & looks of the person doing it rather than what they are actually doing.
This drives a lot of angry behaviour from some men as well as they see their charming handsome friend enjoying lots of amiable flirtation and when they try it and get a different reaction they see this as women being unfair or something, and over time I think this leads to the ones who get really really angry with you when they don't get the coy smile and flirty chat they were hoping for.
Whole thing is a minefield.
At the more trivial end, harassment is in the eye of the beholder.
eg if a man sits next to me on the bus and smiles and starts chatting a bit flirtily and he seems OK I'll think OK whatever and go along with it (although me being me I would resent having my attention commanded in this way and have to go along with it or be seen as "rude" or whatever) as long as he's not weird. If he did the exact same thing to my DD on the way home from school it's not OK. She has not yet learnt how to handle this stuff from men and would not know how to react. She wouldn't know how to gauge if this was a threat.
So it's not really as simple as - this is innocuous - this is harassment. The situation / who's on the receiving end matters too.
I know that I experience things as annoying and unwanted and actually just fuck off and leave me alone that some friends would be happy with. I have never understood why they enjoyed it. Sometimes they found it funny?
We're all different.
I would have ditched the few nice for the loads of awful in a flash.