This is thought to be due to convergent evolution. It is of ancient evolutionary origin, and is homologous to nerve globins of invertebrates.
The presence of this structure is thought to be due to the process of convergent evolution.  It shares a common ancestry with invertebrate nerve globins.