stop somebody from doing something
Why should we use the preposition "from" here? What is it for? Why not use "stop somebody to do something"? This really confused me.
In many cases, there's not really a reason why we use one preposition rather than another. In this case, though, I'd say we use from because it conveys a sense of away, apart, separate (you're keeping the person and the action "apart").
But note that we don't need to use a preposition at all - "She sang a lullaby and stopped the baby crying" is fine (as is "...stopped the baby from crying"). Also note that in related constructions like "She helped the baby to eat", "to" isn't a preposition as such - it's just the "marker" for the infinitive verb form "to eat".
And while we're on the subject, I'll also say that in "She sang the baby to sleep", the preposition "to" seems quite "rational" to me because it reflects "movement" from wakefulness to, towards sleep.
I enjoy seeing how dictionaries try to meet the challenge of defining a preposition. These little words are quite versatile and are used in a variety of contexts, so it's hard to capture all their nuances in small handful of definitions. For example, one dictionary lists 23 different definitions for for. (I just used the word for twice, but it's not always easy to map the usage to a particular definition.)
In the case of from, Houghton Mifflin lists five definitions; Collins lists seven. ODO has 11, and Macmillan uses 15 different definitions to describe how from can be used. Despite those varied ways of dividing up the word, all of those dictionaries list the meaning you've mentioned: where the word from is used to indicate prevention.
Here's how two of those dictionaries describe that definition:
The ODO seems to list that usage under two separate definitions (#7 & #8):
- indicating separation or removal ⇒ the party was ousted from power after sixteen years
- indicating prevention ⇒ the story of how he was saved from death
Macmillan describes it as:
- used for stating what has been prevented or protected against ⇒ kept him from sleeping (Macmillan #14)
Cambridge has a concise list of 14 usages of from, to include
ORIGIN; the usage you've provided falls under
PREVENTING, which is defined as:
used to show what has .. stopped happening ⇒ The bank loan saved her company from bankruptcy
I'll add that "stop from" is what we tend to use on this side of the pond (U.S.), whereas leaving out the "from" is more usual in the U.K. And my sense is that whether you are used to saying "stop the baby from crying" or "stop the baby crying," you would have some discomfort if you tried to phrase it as per your "stop to do" suggestion, which would create a construction of this kind: "stop the baby to cry." The problem here is that this places the verb in the infinitive, which takes away the sense of either ongoing or imminent action. You don't want to lose that, because that's fundamental to stopping somebody from doing something; you are causing something (ongoing action) to cease, or preventing something (imminent action) that is about to happen.
There are some differences --John Landsberg touches on them-- between US and Commonwealth usage for "from" and "to".
In the US we usually say "different from" for the reason FumbleFingers gives: "different" means there's a distance between, and "from" makes that sense of distance feel stronger.
In Commonwealth countries we usually say "different to", presumably because we're at one point of the difference and thinking about the other point that's some distance away.
"Different", however, is a state, not an action.
"Stop", "prevent", "restrict" are all very definitely actions, and all imply a metaphorical pulling-away. Pulling-away requires from; it can't work with "to" because "to" decreases distance and the whole point of pulling away is to increase distance.
We might exile the cat to the bathroom with the door shut while we fold and put away the fresh laundry, but the purpose of doing it is to prevent the scoundrelly beast from jumping into the laundry basket and getting cat-hair all over the warm, laundered clothing (which, as anyone knows who supports one of those warm-hearted, funny people, is exactly what they'll do every time!).