This is a hexbug larva, and yes, it looks a bit like a baby Ceti eel from The Wrath of Khan. It’s autonomous, so the redirection is happening on its own. What’s going on?
Little flashy infrared LED, with a sensor below it. (I used my IR webcam to film these shots). It’s intermittent, which I assume is to screen out any DC signal from background light and detect pulses in the same pattern.
Here’s the underside, where you can see the locomotion details. Not sure of the sex, though, or what happens when it grows up.