The dative, or indirect object, is one of the four core cases - those cases that are almost universal in languages that have case - along with nominative/absolutive, accusative/ergative, and the genitive.
While the details vary by language, the general concept for the dative is a goal or direction of an action (especially with regard to transfer or movement), or the one perceiving an action. In the study of grammatical role, the dative roughly corresponds to the role of goal (although it may have additional uses in a given language). While English has pretty much lost its case system, the logical dative remains, usually expressed with the prepositions 'to' or 'for'.
Some examples of the various uses in several languages from Wikipedia and other sources (note that I'm mainly covering the most common uses, not ones that are specific to certain languages):
Goal of Transfer:
Latin: "Regina puellae pecuniam dat" ("The queen gives money to the girl")
Japanese: "Kodomo ni yaru" ("Give to the child")
Goal of Movement:
Japanese: "Ano hito wa gakkou ni haitta" ("That man has gone to the school")
Goal of Intent or Benefit
Latin: "Auxilio vocare" ("I call for help")
Latin: "Puellae ornamento est" ("It is for the girl's decoration")
Latin: Graecis agros colere ("To till fields for the Greeks")
Greek: "τῷ βασιλεῖ μάχομαι" ("I fight for the king")
Greek: "πᾶς ἀνὴρ αὑτῷ πονεῖ" ("Every man toils for himself")
Goal of Experience:
Latin: "Vir bonus mihi videtur' 'the man seems good to me"
Latin: "Quid mihi Celsus agit?" ("What is Celsus doing [that I am interested in]?")
One of the more peculiar uses (at least for English speakers, as I don't think English has anything like it), is the dative of possession. This renders phrases of possession as phrases of existence with the possessor in the dative. The logical basis of this usage is that in terms of grammatical role, in phrases of possession the possessor is technically classified as the goal.
Latin: "Angelis alae sunt" (literally "For angels there are wings"; freely "Angels have wings")
Greek: "ἄλλοις μὲν γὰρ χρήματα ἐστι πολλὰ καὶ ἵπποι, ἡμῖν δὲ ξύμμαχοι ἀγαθοί" (literally "For others there is a lot of money and ships and horses, but for us there are good allies")
Japanese: "Watashi ni tsuno ga nai" (literally "For me there aren't horns")
Tsez: "Кидбехъор кIетIу зовси" (literally "For the girl there was a cat")