How to add a custom field to the frontend registration form (a ready example)

How do built-in Magento modules add a custom block to the frontend customer registration form?