I am a Homebrew user and have noticed very large files. It seems to have something to do with git, I searched with Brave Search for "Git pack format" but didn't understand exactly why they are so big and are on every MacBook with Homebrew installed.
Basically they contain the history of all the files that have and are in the repository.
This can be limited by choosing just the recent versions of the files when you clone the repository, ie create it on your machine.
The details of using git are off topic on this site try StackOverflow - but a quick search gives https://stackoverflow.com/a/6358656/151019 saying you have to rewrite history if you wanted to reduce the size of an existing repo and that is not going to be practical for the HomeBrew repo - so I think you'll need to reclone the repo,