There was usually a purpose in this that was more profound than just being bored or lonely or something, but none was really required.
And maybe the person they were trying to find wasn't home right now, but that was OK. It was not weird to talk to whoever for a minute, or to hang out for awhile.
Nowadays, the ubiquity of personal pocket supercomputers means that the closest most people ever get to that kind of generally-welcome (if unexpected) interaction is a text message.
"Hey, I'm in front of your house. Are you home?"
And maybe that works more efficiently between two individuals than knocking on the door did, but otherwise this present way of doing things mostly just serves to further increase our social isolation.
Sometimes it seems that the closer it is that our technology allows us to be, the further it is that we actually become.