In the old days, a keyboard was "mechanical" if it didn't involve a non-mechanical step in the key action.
So a Hall-effect switch wasn't mechanical, because it used an electronic chip to detect a magnetic field. Capacitative switches would also be considered electronic, since you needed electronics to generate the high frequencies used to measure capacitance. A reed-relay switch would be a borderline case.
Both of those, of course, had metal springs to return the keys back to position.
And, by this criterion, a rubber dome contact switch would be mechanical. But the first touchpanels were capacitative. Still, one usually thinks of something as "mechanical" more readily if it has metal moving parts, like an alarm clock... or a Cherry or ALPS switch.
So the term "mechanical", as it is now used, is something of a misnomer. The main distinction between the switches called mechanical, and those that aren't, though, could well be the metal springs these days - because flexure in a rubber sheet leads to much shorter life than flexure in a metal spring, 10 million instead of 50 million keypresses.
So one has the rubber dome switches at the short lifespan end of the spectrum, mechanical switches in the middle, and the older expensive (but not tactile) technologies like reed relay and Hall effect provide the longest lifespan.