Messages attachments taking up over 30GB, despite iCloud storage being turned on
On my 2017 MacBook Pro 13", I have been running low on storage. I've deleted as much as I can, but one thing that remains is the space taken up by Messages—32.91GB. What confuses me is that all of my messages are stored in iCloud, so why is so much space being taken up on my mac? I am not running out of iCloud storage, and I have tried disabling/enabling iCloud storage in the Messages app with no success.
My two main questions:
Why are all of these attachments stored on my mac in the first place?
And if I delete them, what will happen to the attachments that are in iCloud?
I only have a 256GB ssd, and I desperately need the space to update XCode. Thank you in advance for your help!
MacBook Pro 13″, macOS 11.5