I am a father of two kids. I can be walking on the sidewalk with my kids, and see another parent, maybe a mom, smile and say hello, it's totally fine.
Same situation, but maybe my kids are not with me, maybe they're in school. Suddenly I'm a strange man saying hello at a mom and her kids. A real danger situation! Hold onto your bag, hold the kids extra tight, reach for the pepper spray. But I am the same person in both situations.
But mindful of this, I keep a respectful distance in the latter case.