Mac storage basics · Caches, logs and temporary files
What is the Containers folder in my Library, and can I clean it?
Short answer: They hold sandboxed apps' private data — caches, settings and often the only copy of documents. Don't delete them wholesale; clean up via each app or for uninstalled apps.
~/Library/Containers and ~/Library/Group Containers hold data for sandboxed apps — mostly App Store apps and Apple's own apps. Each app's container is its private Library, with its own caches, settings and documents.
Don't delete containers wholesale: for many apps they hold the only copy of data (Mail, Notes and Messages-related apps among them). Clean up from inside each app, or remove a container only for an app you've uninstalled.