Similarly, if I hear someone shout something that interests me, I can begin a conversation with them which may lead to getting details of their identity, unless they're actively concealing those details. Or follow them home, and so forth, as you start moving to less and less ethical options.
Attaching real names to statements online does make the process ridiculously easy, though, and it would probably be useful if social networks had a "do not expose my identity (in comments, etc.) to people who are not already my friends (or friends of friends)." That seems (to me, at least) to be rather more similar to how the real world works.