This book gives a really good, concise history of the internet, thankfully forgoing the boring technical details, tracking it's inception and growth.
The short of it is that the great inventor of the internet was none other than the US military, with the primary design being communication and data collection/processing in war zones. As the technology developed, it was expanded for domestic use.
Towards the end of the 20th century, CIA fronts and black budgets poured money into tech start-ups so that almost every company that still survives today has/had US government backing. Google, Amazon, Facebook etc etc all receive funding from federal agencies and all work closely with federal agencies. All that data and all those cookies are not simply for giving you convenient adverts. It's spying for the US government.
I remember seeing all that nonsense about Google having slides in their office. How fun it is to work for Google. Yes, all that nonsense about Google being harmless tech nerds is a psyop. The CIA crafted this artificial image of tech nerds being counter-culture when really they were working for the feds the whole time.
