What is Hard Fork?
A Hard fork can be defined as a change in the protocol which makes previous transactions or blocks invalid. If somehow the older version exists or runs they will surely end up with a different data and protocol compared to the newer ones resulting in a possible error in the near future.
When both the older and newer version exists using the old and new software respectively, then a split occurs. When the split occurs there are two paths created in the blockchain. The new path follows the upgraded software, on the other hand, the old path follows the same old software.
Usually, after this splitting, the old blockchain realizes that its version is irrelevant or outdated and automatically upgrades it to the latest version available.
How Hard Fork occurs?
A hard fork can occur in two different ways; either it will be “planned” or “contentious”.
As the name suggests a planned hard fork is created by the permission of the developers. All the nodes agreed to upgrade the blockchain software to the latest version available resulting in a lower chance of fork split.
Whenever all the nodes not get agreed with the rules during implementing the hard fork, a contentious hard fork occurs. A split in the blockchain occurs due to contentious hard fork.