> curl -sI https://formulae.brew.sh/api/formula.json | grep content-length => 19898457 (~19.9MB)
> curl -sI https://formulae.brew.sh/api/cask.json | grep content-length => 4023930 (~4MB)
But the JSON API has been around for a while so brew 4.0 just makes use of it by default.
Brew 3.3 added an off-by-default HOMEBREW_INSTALL_FROM_API bool to let you install from brew's JSON-based API instead of checking out the large (and slow) homebrew/core and homebrew/taps repos: https://formulae.brew.sh/docs/api/
Brew 4 just makes that the default and deprecates the env var (you can use HOMEBREW_NO_INSTALL_FROM_API=1 if you still want to check out the git repos for some reason).