A mechanism is a mechanical device for doing something. It includes the idea of tools and machines, but is used for a wider range of objects, processes and ideas.
Palaeolithic hand axes were one of the first tools used. Simple modern mechanisms would be rope pulleys or levers. The internal combustion engine is a mechanism for turning oil into motion. A complicated example would be computers and the web.