Many verbs of giving or showing are ditransitive in English, and allow these two different argument structures:
I gave the keys to Sarah. <=> I gave Sarah the keys.
Sarah showed the book to me. <=> Sarah showed me the book.
Tom offered a cake to them. <=> Tom offered them a cake.
In each case the meaning is the same, and you can see from the to that the recipient is semantically an indirect object, and the thing given, shown, or offered is a direct object.
As long as both are present, you can put the indirect object before the direct, without a preposition.
Other verbs which can be used in this way are promise, present (in the sense of "give in a ceremonial way"), and sell.
This is also possible with some other verbs with a "benefactive" object, using the preposition "for":
I baked a cake for Sally. <=> I baked Sally a cake.
He built a house for us <=> He built us a house.
Will you buy some oranges for me? <=> Will you buy me some oranges?
The benefactive (the person you're done the action for) isn't part of the meaning, so it isn't required (He built a house. I baked a cake) but if you expressed it, you can use this ditransitive construction.
But you can't do this with every verb
I washed the windows for her. But not *I washed her the windows.
I think the restriction is that the beneficiary must end up with something they didn't have before.