It seems that in almost all other species, especially primates, baring one's teeth is a threat or a show of potential force. Somehow we seem to have taken the fright-threat sort of smile and extended it to strangers as a presumably friendly smile. Maybe it is not as innocent as it seems.
All cultures recognize a variety of mouth gestures as indexes of inner emotional states.
As in our own culture, however, smiles come in many varieties, not all of them interpreted as friendly. Frank McAndrew , professor of psychology at Knox College in Galesburg, Ill., has done extensive research on facial expressions. In primates, showing the teeth, especially teeth held together, is almost always a sign of submission. The human smile probably has evolved from that. But if the teeth are pressed together and the lips are relaxed, then clearly you are not prepared to do any damage.