During the installation of brew, a git repository is downloaded to /usr/local/Homebrew.

  • brew update updates this git repository
  • brew upgrade upgrades the packages to match the versions in the updated git repository