When you run apt-get update, it tries to connect to all of the repositories listed in the file and download information about them, such as what programs are available. It saves all retrieved data locally so that it can be used later without having to go to the repository.