Both an ERD and a UML class diagram can show teams and players. Their similar nouns can hide different modeling questions. The ERD below organizes stored records. The class diagram organizes the software objects that use those records.
The relationship is implemented in these records by matching TeamId values. The ERD can explain the one-team-per-player data rule and which key must exist; it does not show a live object reference or a sequence of method calls.
The software can resolve TeamId during loading and store a reference to the resulting Team object. A class model may also keep the IDs when persistence needs them. The relationship concept is related, but the storage representation is a deliberate choice.