Interestingly enough, it's both.
With Psychopathy someone is born without the capacity for empathy with no environmental trigger necessary to "activate" psychopathy.
With Sociopathy it's generally that childhood trauma "triggers" the lack of empathy.
In both cases, the manifestations of the disorders (manipulation, ego-centrism, grandeur, deceit) are there to cope with the lack of empathy and connection with other people.