A robot was a machine that automatically performed a set of typically pre-programmed tasks and had limited autonomy. (TOS: "I, Mudd")
In early science fiction writing, the idea of a robot tended to include thinking machines that could perform independent judgments. Later, this was revised to the idea of an android and the notion of robots became limited to less advanced forms of machines. The basis for this change is generally credited to Isaac Asimov who, though referring to them as robots, created characters who were far more intelligent than Humans and operated according to the "Three Laws of Robotics" which later became the accepted basis for many characteristics of android behavior.