Accidental fork occurs if updates of a network are not compatible. People using different versions of the software create two different registers: one from the old version and one from the newer version. In this case, developers must quickly eliminate errors that cause incompatibility and decide how to combine two different blockchains.
Hard fork is created when developers decide that it is necessary to make changes to the program part of the cryptocurrency, which will create incompatibility between the older and the newer version. When changes are made, all users of this network should be ready to update all applications in order to continue to use their coins correctly.
Often as a result of a combination of two aforementioned cases, a new, based on the old one, cryptocurrency might be created. This new cryptocurrency may also be called fork. For example, a Bitcoin fork Namecoin (NMC) is the first fork in history.