master is a reference to the end of a branch. By convention this is usually the main integration branch, but it doesn’t have to be. (As of git v2.28.0, released in July 2020, the default name changed from master to main)
HEAD is actually a special type of reference that points to another reference. It may point to master/main or it may not (it will point to whichever branch is currently checked out). If you know you want to be committing to the master/main branch then push to this.
Here is a visual example:

On your own repository you can check where the HEAD is pointing to by running this:
$ git symbolic-ref HEAD
refs/heads/master
However, finding out where the remotes/origin/HEAD is pointing to is more tricky because it is on the remote machine.
There is a great little tutorial on git references here