Hard Fork
A hard fork occurs when a blockchain protocol changes such that nodes must upgrade their software or cannot connect to the upgraded network and can result in two divergent networks. Developers will introduce a set of changes to a protocol making the new protocol version incompatible with the original, meaning nodes either have to upgrade to and adopt the latest version or continue operating the original version. If some nodes continue to operate the original version, creating blocks and processing transactions, the fork will result in two blockchains, as happened during the Bitcoin and Bitcoin Cash hard fork in late 2017.
When a hard fork occurs, nodes running older versions of the protocol software will reject blocks from nodes running newer versions because they contain transactions the older version considers invalid. As a result, two competing blockchains emerge, and all users (nodes and users) will choose between the different mutually-incompatible versions.
A hard fork differs from a soft fork in that the latter only introduces protocol changes considered 'backward compatible', i.e., the changes don't conflict with the existing protocol rules, and nodes are not forced to upgrade their software to stay connected to the network. In the case of a hard fork, some or all of the changes are not backwards compatible, meaning that nodes must upgrade or be unable to connect to the new protocol version.