How is a password's hash is generated while a customer is registering?

The registration form’s block:

The registration form’s template with the «Create an Account» button highlighted:

The registration form’s action value (the URL where the form’s data will be sent):

The server handles the data sent with the controller:

The $hash consist of 3 parts, separated by :

A password’s hash is stored in the Magento 2 database in the encrypted form:

When a customer is imported by the standard Magento 2 tool, then you can set a plain password for the customer, and the hash will be generated automatically:

See also: