What is the purpose of entity_keys in ContentEntityBase? I'm trying to figure out what is the purpose of entity_keys in ContentEntityBase entities and what fields should be set as entity_keys.

For example in \Drupal\node\Entity\Node we have such entity_keys:

entity_keys = {
 "id" = "nid",
 "revision" = "vid",
 "bundle" = "type",
 "label" = "title",
 "langcode" = "langcode",
 "uuid" = "uuid",
 "status" = "status",
 "uid" = "uid",
}


Why exactly these fields are selected to be entity_keys? And, for example, why in \Drupal\comment\Entity\Comment status isn't in entity_keys?
entity_keys are basically an alias for fields. It allows generic code, like the storage backends, to access common fields that have different names, for example the ID. They need write the saved value, so the can't just use id() as most places.

Internally, those keys are also used by generic methods like id(), label(), getRevisionId() and so on, so they work out of the box.

There isn't really a reason that comment doesn't define status. Nothing really uses status, if you search for getKey('status'), there are no matches, while getKey('id') finds a lot.

Node only uses it internally for the isPublished().