I don't know for certain what makes one country violent and failed, and another successful and stable. I suspect predisposition to violence, disregard for laws, and high level of personal ambition in population will lead to failed societies run by gangs and warlords. I suspect that disdain for violence, respect for the rule of law, and high level of personal ambition in population will lead to successful societies lead by an autocrat or as a republic. However, this is just a speculation.
If I were building society from scratch, I'd likely try to keep violent, unruly people out. Maybe if I keep them out too much I will end up with a stagnant collectivist society, some kind of a large hippie commune, but I will certainly will not end up with a warzone. I can say with certainty that US already has plenty of violent and unruly people and that stagnation due to docile population is not in the cards.
Europeans have a very long history of wars, colonialism, religious fanaticism and illiberal tendencies. Is all of this in the past? I would like to think so. Despite all of these wars, religious fanaticism, and illiberal tendencies today all are democratic liberal societies. Would it stay that way? I hope so.
As to shithole countries. It is certainly not the climate. Empty, for example, Liechtenstein and transport all people from a shithole country there and you WILL have a shithole in Liechtenstein. That, I am fairly certain of.