A public blockchain can only exist by many node computers running the same software, which collectively maintains the record of the past of the network. Public blockchains offer completely open-source code, which allows any developer to iterate off of the existing code and make any changes that they desire. If either the collective record or the software that maintains it is questioned, there can be a fork in the network. There are three main types of forks:

Temporary Forks:

The most common way in which a fork occurs is when there  separate groups of nodes reach have different copies of the blockchain ledger. This can happen when there’s a high transaction volume, and nodes find multiple new blocks which can be confirmed within the rules of the system. In Proof of Work models, the longest chain will always win, so the network will ultimately return to a global consensus quite quickly.

Permanent Forks:

Soft Forks:

A soft fork is a network upgrade which can be thought of a non-mandatory. Nodes running old versions of the software will still be able to interact with and maintain consensus on the network.

Hard Forks:

A hard fork is a network software upgrade or change that either forces nodes on the network to upgrade or results in a permanent split in the network.

If nodes running the old version of the software they will end up of their own network, with their own version of blockchain data, separate from the nodes that upgraded. This situation results in two separate networks.