Voting for right wing candidates is what prevents us from solving this problem. That and vulnerabilities in human cognition used by psychopaths to become God Kings.
Theology is a thing because several secular democracies in the world are quickly collapsing into theocratic dictatorships.
This is a problem for the future existence of the human race because the religious extremists being put in charge are completely insane and genuinely believe God will protect them and give them dominion over the Earth.
This means that when they inevitably start massive wars due to their incompetence and collapsing empires they will turn to nuclear weapons as a solution.
The reason theology is a problem is that their theology is nationalistic supremacy. They believe they are God's chosen people and protected by and elevated by God. So like a kid who believes they can fly because of Superman they're going to believe they can start a nuclear war that they can win.
Now the reason is ties into ai and job destroying automation in general is that people under heavy pressure and duress don't make good decisions. They are likely to turn to right-wing demagogues because they're going to offer simple solutions to confused and frightened people. More importantly they're going to offer solutions that don't run contrary to the cognitive vulnerabilities those people have. Specifically that whole crap about how angry it makes people when somebody gets to stay home playing Xbox and they have to go to work.
That's how it all ties together. Automation collapses our social systems, we are not capable of building new social systems because of cognitive vulnerabilities and issues, so we turned the right wing theocratic lunatics because they offer solutions that we can understand and it fit in with our cognition. Those right wing lunatics believe they are protected by God and start a nuclear war and you get the rest.
It's a multi-step process and I think that's why you're having a tough time following it from its beginning to its conclusion. It requires dozens of systems designed to prevented to fail and break down which they have.
I've said it before and I will say it again, every single system designed to protect you needed to break to get us to this point and they did.