On a blockchain, a hard fork is a radical change to the network’s protocol that makes previously invalid blocks and transactions valid, or vice-versa. A hard fork requires all nodes or users to upgrade to the latest version of the protocol.
A hard fork is the only way to update a blockchain and its protocols. For example, when the BCH network was created, its developers split from the BTC network and literally created a new blockchain with modified rules.
Adding a new rule to a blockchain’s code essentially creates a fork in the blockchain: one path follows the new, upgraded blockchain, and the other path continues along with the old blockchain.