In my opinion, this phenomenon of trying to engage a passing woman in conversation or just saying something is not unrelated to the phenomenon of sending dick picks, in that there is, I think, a common component, some men apparently not understanding how something they do is likely to be received, not understanding the 'rules of engagement' (or ignoring them). I'm willing to bet that in many cases, the men actually think that either (a) the behaviour will be welcomed or (b) that even if they realise it's not likely to be welcomed, there is at least a chance that it might, even if it's an outside chance. Maybe one day they will strike it lucky. If you're not in you can't win. Etc.
Allied to which, and not to excuse such behaviour, but males of our species are in competition (with other males) for access to females, and as far as I know always have been, just like males of many other species, and this leads to males sometimes employing bold strategies. And, those with the least to offer a female (in terms of things that might attract her, such as wealth and status, but also wit, understanding and others) often have to employ the boldest strategies of all, especially if they lack creativity and guile. Again, as in many other species.