With the exception of octopi, primates, birds and cetaceans, animals that do extremely intelligent actions turn out to be automatons.
Usually when observing and experimenting animals closely, especially insects, they are just state machines. Very complex sequences are often executed from start to finish blindly. You can reveal how ants, bees or flies are automatons by making little changes to their environment. They do the sequence from start to finish. If you interrupt them, they can't start from where they ended. They start the sequence from the start.