In both Spanish and English (and many, many other languages) we have direct objects and indirect objects. Not surprisingly, the direct object (DO) “directly” receives the action. It answers the question “what?”
The indirect object (IO) receives it “indirectly,” and answers the question “to whom?” or “for whom?”
Let’s look at a very basic example in English: