Is psychology a science or magic? What makes a person to be ever smiling to an extent that they just can't be angry or actually show they are angry even if they are?
From David Myer's Psychology, 10th edition, Page 6,


  Psychology is the science of behavior and mental processes.


To answer your actual question, here is what David has said in general that there are 3 levels on which Psychology can be viewed at differently. Following image lists them.


Each level forms an independent yet dependent abstraction with other two. So, to answer your question, the person's current external environment(Socio-Cultural environment which could include his friends, family, lover, stranger, native or foreign society, etc.), internal environment (current biological state which includes hormones,health, other physiological processes, maybe some disease) and Psychological influences(Learned behavior and knowledge shapes the understanding and interpretation of context ) might have created a triad to give the resultant situation.

So, the person might have scored a perfect score in SATs but might have had a emotional breakup the same time which might lead to the situation mentioned by you. Of course, there are infinite possibilities.
I just listed one of the possible Socio-cultural factor. Use your imagination to figure out the rest of the infinite possibilities.

Good Luck.

P.S: It is not magic BTW!
From Wikipedia,


  Magic or sorcery is the use of rituals, symbols, actions, gestures and
  language that are believed to exploit supernatural forces.