With verbs such as "cacher quelque chose à quelqu'un" or "éviter quelque chose à quelqu'un", we can see the preposition "à". But from my knowledge of French, this preposition very often has the meaning "towards". But in cases of "cacher" and "éviter" it means "from" (to hide something "from something").
Is there any reason of why it happens (perhaps historical one)? How should I think about it?