You take the time to observe people. You watch without judging them. You wonder with every action and reaction they make/give to another person what makes them do that. Kind of like logically piecing a system together. You gather information on their background, their passions, their interests, their current life, the situation itself that the (re)action was set in and the person that seemed to trigger it. You wonder how you'dve responded in that situation. You do a background check etc on yourself as you did with him, to get a comparison. And you check what the general reply of people is in that situation to get a baseline. Then you fuse it all together. You check for discrepancies, things that still don't make sense. You zoom in on those and smoothe them out by either reaxamining or gathering more info. Finally, when all the pieces fit, you test your theory on the person. And then you know the answer to all the questions you asked. It'll be like walking in their shoes at least in that situation. And then you press repeat on that button for every new situation you see them in. Till you know them so well, that you can walk in their shoes for real. That, however, is in most cases just a dream. But one worth striving for. With every person it becomes easier and your educated guesses will become more educated and your calculated risks smaller.
And then, you apply this knowledge to motivate them as you will know what will cause which reaction. And you realize that abusing it would be like shooting yourself in the foot.
Note: this is also fascinating to do on yourself and highly ironic, amusing and frustrating at times. Like looking in a mirror that reflects back your soul.