Clarification regarding use of personal access tokens

Hello, I’ve been trying to start using git for some basic stuff. Recently I had to use 2FA to login to the mozilla discourse forum with my github account, and this required me to set a personal access token to be able to access the repos through the git api. All’s well with that, only I find the new workflow quite inconvenient. In the relevant help page I see this:

Warning: Treat your tokens like passwords and keep them secret. When working with the API, use tokens as environment variables instead of hardcoding them into your programs.

I’ve never quite understood environment variables, so I don’t understand what this is about. I think it hints of a way to use personal access tokens more conveniently, though. Can someone clarify?