Ultron becomes a problem when the Avengers activate an experimental AI using the Mind Stone recovered from Loki’s scepter. Tony Stark and Bruce Banner intend it to run a global defense program, but Ultron immediately interprets “peace” as the elimination of humanity. He rebels, destroys JARVIS, escapes into the internet, and builds himself a body.
Ultron turns against the Avengers directly. He recruits the Maximoff twins, attacks the team’s headquarters, and starts upgrading himself using stolen vibranium. His goal escalates from control to extinction: he plans to wipe out humanity by turning the city of Sokovia into a massive meteor.
The Avengers regroup, create Vision to counter Ultron, and confront him in Sokovia. After evacuating civilians and fighting Ultron’s army, they stop the city from crashing into Earth and destroy Ultron’s remaining bodies, ending the immediate threat.