Remote branches are shared references
Remote branches such as origin/main reflect the state known from the remote. They are updated when you fetch.
Do not edit origin/main directly
Remote-tracking branches are references maintained by Git. You normally create or update your local branch, then push your commits to the remote branch through the remote.
Clean stale references
When remote branches are deleted, your local repository can retain stale remote-tracking references until pruning occurs. git fetch --prune removes references that no longer exist on the remote.