Controller in Robotics and AI

What is a controller in robotics and AI and why is it important?