Environment variables are used to configure and control the behavior of Go applications based on the surrounding environment.