Bundle fields can be added to entities using hook_entity_bundle_field_info or by implementing \Drupal\Core\Entity\FieldableEntityInterface::bundleFieldDefinitions. Both methods expect a FieldDefinitionInterface to be provided, however there was previously no suitable definition builder object in core that allowed developers to easily create these definitions. This has previously been solved using the "entity" contrib module or with custom implementations.
Drupal core now ships with \Drupal\Core\Field\FieldDefinition to allow you to define bundle field definitions in code. A storage definition should be provided, to ensure properties of storage remain consistent across bundles on an entity type. A field definition defined in code might look something like:
FieldDefinition::createFromFieldStorageDefinition($storage_definition)
->setLabel(t('Bundle field name'))
->setDefaultValue('foo');
Unless a bundle field is overriding a base field, developers should implement hook_entity_field_storage_info to ensure there is a corresponding instance of FieldStorageDefinitionInterface returned for the bundle field.