Fun fact! Octopuses/octopodes/octopi (I'm not arguing about this because it's three different root languages and at least 2 are acceptable to most people) are fucking weird. Usually the male octopus will tear off their penis arm and throw it to the female since the females are extremely voracious eaters and will eat the male if they get too close. When the female ends up laying their eggs, they start making a hormone that makes them not hungry anymore so they don't eat their eggs - it often leads to the mother starving to death while guarding them
Essentially for both it's hormone overload. They've got a gland behind their eyes that puts them into reproduction mode and once it turns on it never turns off until it kills them. They stop eating and eventually go crazy.