Mechanical means worked by machinery. A mechanical problem, mechanical engineering, a mechanical failure.
The second sense is done without thought, in the way a machine works: a mechanical response, mechanical repetition. That use is always slightly critical. Mechanical engineering is one of the main branches of engineering. Note mechanically, mechanism, and mechanic; and that in aviation and motoring a mechanical is used as a noun by racing teams to mean a mechanical failure.
1adjectivemechanicalWorked by machinery.
“It was a mechanical failure and it cost them the race.”
2adjectivedoneDone without thought.
“She gave a mechanical smile and went on typing without looking up.”
mechanical is a quality of machinery or automatism.
Greek mekhanikos meant ingenious, from mekhane, a device. Machine, mechanic and mechanical all descend from it, and the older sense of ingenious is entirely gone from the modern words.
Middle English
mechanical
English, today
mechanical
From Middle English mechanical, from und + mekanyk. From Middle English mechanical, mechanicalle, mechanycalle, equivalent to mechanic + -al.
Etymology from Wiktionary, CC BY-SA