The primary key for records in the CDS is a GUID. This GUID is set when the record is created, either by a developer setting it explicitly or by the Power Platform generating it.
The CDS allows for alternate keys to be defined. An alternate key allows external systems that need to read and write records to efficiently access the records without having to first run a query to find the GUID. For example, accounting systems often have an alphanumeric account number that uniquely identifies the account. You can set the account number field in the CDS entity to be an alternate key so that the accounting system can read and write the account using the data it holds in its own system.
Alternate keys are defined in the Maker portal in the Keys tab on the entity. You simply choose which fields you want to act as the alternate key.