Skynet has a specific origin story, explained in the movie, Terminator 2: Judgement Day.
In three years, Cyberdyne will become the
largest supplier of military computer
systems. All stealth bombers are upgraded
with Cyberdyne computers, becoming fully
unmanned. Afterwards, they fly with a
perfect operational record. The Skynet
Funding Bill is passed. The system goes
online August 4th, 1997. Human decisions
are removed from strategic defense. Skynet
begins to learn at a geometric rate. It
becomes self-aware at 2:14 a.m. Eastern
time, August 29th. In a panic, they try
to pull the plug. Skynet fights back. It
launches its missiles against the targets
in Russia. Skynet knows that the Russian
counterattack will eliminate its enemies
over here.
It was an out-growth of the cold war arms race. Nuclear deterrents aren't as much about protection as they are about posturing. Lives aren't quite "saved" by nuclear arsenals.