Thinking robots almost destroy humanity, then awhile later Space Jesus defeats space fascists then goes on to destroy most of the settled universe in a crusade of destruction.
Also for kicks a one sentence summary of the foundation series: mathematicians reduce the time between civilization collapses by predicting the behaviors of large groups & settling remote outposts to restore order, but an unpredictable very powerful individual changes the plan.