Cookie consent is a core part of that compliance for websites with EU-located users.
Cookies are one of the most common ways personal data is collected and shared online, so the GDPR includes specific rules for their use.
That is why end-user consent remains one of the main legal bases for cookie usage and related personal-data processing.