Is the word "work" used in the same way in the following two sentences?

The voting process doesn't work as well as people thought.

The medicine works only if you take it with a lot of water.
the same meaning