The Internet originally was a decentralized military network called
ARPANET that interconnected military sites across the USA.
Its development began in the 1960s, during the Cold War, in order to have a functioning communications network even if one of the nodes got taken down by a Russian attack.
The network was later connected to all the universities in the US, thanks to the new TCP/IP protocol suite.
The network kept expanding: multiple countries joined it, and thanks to the creation of the World Wide Web by Tim Berners-Lee a whole world of new opportunities was opened and led to the spread of the Internet in both homes and companies.