Have many neurons in their tentacles such that a severed tentacle can continue reacting to stimuli even after they are no longer connected to the main brain. If you put food near a severed tentacle it will even try to feed it to a mouth that’s not there.
https://www.smithsonianmag.com/smart-news/severed-octopus-arms-have-a-mind-of-their-own-2403303/
ref - https://www.reddit.com/r/todayilearned/comments/f4bed5/til_octopuses_have_many_neurons_in_their/
origin - https://www.pipiscrew.com/?p=17040 severed-octopus-arms-have-a-mind-of-their-own