Cookies have been around for decades, and honestly, I think at least 90% of all people on the internet have no clue how they work. So why, just in the last few years, does almost every Web site I go to now have a "Cookie Notice" that I have to accept? A "Cookie Notice" wasn't necessary for the first 20+ years they have existed, so what's the deal? Is this related to the General Data Protection Regulation (GDPR)?
Yes, it is related to GDPR. As said in this article:
Why am I seeing more cookies pop-ups lately?
Back in May (2018), a sweeping piece of EU law called the GDPR came into force.
In short, it means companies need to get your explicit consent to collect your data.
If a cookie can identify you via your device (which most cookies do), then companies need your consent.
That's why you're now seeing lots of websites asking for your permission before dumping a cookie on your computer.