Nouns in Hindi are put in the dative or accusative case first having the noun in the oblique case and then by adding the postposition ko after it. However, when two nouns are used in a sentence in which one of them is in the accusative case and the other in the dative case, the sentence becomes ambiguous and stops making sense, so, to make sense of the sentence, one of the noun (which is assumed to be in the accusative case) is put into the nominative case and the other one is left as it is (in the dative case). The noun which is put into the nominative case becomes the direct object of the sentence and the other one (which is now in the Accusative case) becomes the indirect object of the sentence.