I've had non-horse people stare at me when they see a 130 (barely) pound woman dealing with a 1400 pound equine and apparently having perfect control over him.
"How do you make him behave?"
Of course, really, no human can "make" a horse do anything it doesn't want to. Horses can withdraw their consent to be ridden at any time - something that's happened at least once to any long-term rider. Getting "tossed" is an occupational hazard.
But most of the time, these huge animals do indeed do exactly what their handlers ask them to. How?
The answer is several-fold.
1. We've bred these animals for many generations to be tame. Horses that aren't compliant are simply not bred - or in some cases shot and eaten. (And believe me, I've met a couple I would cheerfully have added to my dinner plate).
2. Horses are highly social animals. Unlike dogs, they are not motivated directly by food - horses don't give each other food in nature the way many carnivores do. What they are motivated by is approval (and they can indeed learn that a cookie means approval). If you watch videos of riders you will notice praise being given to horses frequently - because it works.
3. Horses have been bred and conditioned to see humans as above them in the "herd hierarchy." They may challenge that - some more than others - but ultimately they feel secure and happy when they know their place and who is in charge. Which is why you will sometimes see what seem to be harsh techniques being used. If you have a dominant but mentally healthy horse and you kick their butt once, they won't fear you afterwards, they will respect and like you.
The short version is, we get them to do what we want through a combination of dominance and approval that works with horse psychology to convince a horse he wants to do what we want. And, in some cases, by making what we want them to do into a fun game.