Very interesting question and one of my #1 missions in life, it seems... I don't think that there is a definitive formula, rather a combinition of both plus other variables that make us who we are. Everytime I think I have it figured out, someone comes along to prove me wrong, so it is indeed a very interesting and controversial topic that I don't think will ever be solved!
We are born with a certain set of characteristics, then depending on our environment, such as parents, their relationship, siblings, birth order, peers, experiences in school, growing up and eventually life, determines your successes and failures and more importantly, how one reacts to certain events. In a sense, this actually brings up even more questions, such as why do some people, raised with very little emotional support, seem to have an internal drive to succeed, against all odds! And they do. Of course when they fall, we all blame it on their childhood, which may or may not be accurate. Then you have a child with every opportunity in the world, parents that care, the best education, friends, etc. that is prone to depression and a low tolerance for any sort of aggravation - one who is unable to handle life as we would expect. Conclusion-they must be spoiled? Perhaps, and the debate goes on!?