Cybernetics is actually a derivation of the word “Kybernetic” - which was “steersmanship” in the nautical sense.
It is this study that leads scientists to examine the behaviour of something, as opposed to its implementation, and once a behaviour is understood, and broken down, an implementation may become apparent. It borders on animal and human psychology, as well as a little understanding of sensory technology, engineering and similarities with real biology exhibiting the same characteristics. It means you can do high-level behavioural analysis, and then use this to determine the programming.
The University of Reading, England offer a degree, and masters course examining this, with real hands on contact building robots and programming them.