A job is a unit of scheduling: its steps run in order on the same runner and workspace, which is why a checkout in step one is still there in step five. Each run: step is nevertheless a fresh shell, so an exported variable is lost unless you write it to $GITHUB_ENV.
Official docs