Org Credential is creating a new Environment record.Whenever an org credentials is validated for the first time, the field "SFDC Org ID" is populated. The first Id is in that field is the Id of the org where you logged when validating the org credential.
When the validation happens and that field is populated, Copado uses the first Id to search for an existing Environment record to associate the Org Credential with it. We will check the "Org ID" field in the Environment records.
If Copado doesn't find an Environment with the same Id, a new Environment is created with the same name as the org credential.
What happens if you re-validate an existing org credential that was already validated and it had the field "SFDC Org ID" already populated? Copado will NOT update that field.
If you are login in a different org, the field "SFDC Org ID" is not updated with the Id of the new org.
The rest of the process is the same as mentioned above, Copado search for an Environment using the Id in "SFDC Org ID" and it will create a new Environment if it is not able to find an Environment with the same Id.
If you are refreshing sandboxes, please follow the instructions in the documentation Sandbox Refresh to make sure the Org Credentials and Environment contains the right data.