to keep watch: to guard something so it comes to no harm, and by extension to keep a command or keep oneself out of harm's way
The picture underneath this word is a sentry on duty. Its oldest use is literal: a soldier watching a prisoner, shepherds watching a flock through the night, a strong man watching his own house. From there the meaning stretches in a few natural directions, all held together by the single idea of vigilant keeping.
When the thing being watched is a person or a treasure, the word means to protect, to keep safe from danger. When the thing being kept is a law, a command, or a message, the word means to observe it and hold to it faithfully, which in practice means to obey. And when a person turns that same watchfulness on himself, the word becomes reflexive: to be on your guard, to keep clear of something dangerous.
So one image, a guard keeping watch, runs through the whole range. What changes is only what is being guarded: a captive, a treasure, a rule, or your own soul. English needs several different words for these shades (guard, protect, keep, obey, beware), but in Greek they are one verb doing one kind of work.