There isn't any documentation about that.  
In [`SqlContentEntityStorageSchema::getSharedTableFieldSchema()`][1], there is the following comment. (The relevant part is *For now, we only hardcode 'not null' to a few "entity keys", in order to keep their indexes optimized.*)

```php
// A shared table contains rows for entities where the field is empty
// (since other fields stored in the same table might not be empty), thus
// the only columns that can be 'not null' are those for required
// properties of required fields. For now, we only hardcode 'not null' to a
// few "entity keys", in order to keep their indexes optimized.
// @todo Fix this in https://www.drupal.org/node/2841291. 
```

[Fix NOT NULL handling in the entity storage and 'primary key' changes when updating the storage definition of an identifier field][2] has been opened to remove the code that mark as `NOT NULL` some of the entity keys given for an entity type.

As a side note, the current workaround isn't to manually edit the database schema, but to override the `getSharedTableFieldSchema()` method implemented by the entity *storage_schema* handler.  
This is what the [File][3] entity type does.

```none
handlers = {
  "storage" = "Drupal\file\FileStorage",
  "storage_schema" = "Drupal\file\FileStorageSchema",
  "access" = "Drupal\file\FileAccessControlHandler",
  "views_data" = "Drupal\file\FileViewsData",
}
```

[`Drupal\file\FileStorageSchema::getSharedTableFieldSchema()`][4] contains the following code.

```php
// Entity keys automatically have not null assigned to TRUE, but for the
// file entity, NULL is a valid value for uid.
if ($field_name === 'uid') {
  $schema['fields']['uid']['not null'] = FALSE;
}
return $schema;
```








  [1]: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Sql%21SqlContentEntityStorageSchema.php/function/SqlContentEntityStorageSchema%3A%3AgetSharedTableFieldSchema/9.3.x
  [2]: https://www.drupal.org/node/2841291
  [3]: https://%20https://api.drupal.org/api/drupal/core%21modules%21file%21src%21Entity%21File.php/class/File/9.3.x
  [4]: https://api.drupal.org/api/drupal/core%21modules%21file%21src%21FileStorageSchema.php/function/FileStorageSchema%3A%3AgetSharedTableFieldSchema/9.3.x