A fork in a blockchain refers to any change in the network protocol that results in the creation of a new version of the blockchain. A fork occurs when the software protocol of the blockchain is updated.
If there is a disagreement between the miners or nodes in the blockchain, a fork could result in the creation of two blockchains - the original version and a new version. This is known as a hard fork event.
For instance, a hard fork in Ethereum occurred in 2016 following the DAO attack, where a loophole in the DAO (Decentralized Autonomous Organization) smart contract was exploited and a significant amount of Ether was stolen. As a result, the Ethereum community decided to hard fork the blockchain to recover the stolen funds, resulting in two separate chains - the new one known as Ethereum (ETH) and the original, unaltered chain known as Ethereum Classic (ETC).
On the other hand, a soft fork offers backward compatibility where the acceptance of the update by a majority of the miners or nodes is sufficient to enforce the update. A soft fork becomes more resilient and effective when a higher percentage of participants accept the software upgrade.