Smiling is fundamental. Fetuses have been observed smiling in the womb. In ethology, I think it's considered what's called a fixed action pattern, it is basically hard-wired in us. But of course, the environment and culture modifies this behavior and its meaning.