In A1 you learned two core cases: Nominativ for the subject (who performs the action) and Akkusativ for the direct object (who or what the action lands on directly). Now you meet a third case, Dativ — the case of the "receiver" or "beneficiary" of an action. It typically answers the question Wem? — "to whom?" or "for whom?"
Why do you need a third case at all? Picture the sentence "I gave the book to my brother": there's a subject (I), a direct object — the thing being given (the book) — and a second object, the person who receives the action (my brother). Many languages mark that receiving role with a preposition like "to." German instead changes the article and the pronoun itself to reflect this role: Ich gebe meinem Bruder das Buch.
When exactly does Dativ show up? First, with the indirect object in sentences that have two objects, as with geben (to give), schenken (to give as a gift), and zeigen (to show). Second, after a fixed set of prepositions that always trigger Dativ, no matter the context, and simply have to be memorized as a unit: aus, bei, mit, nach, seit, von, zu, and also gegenüber — unlike the two-way prepositions you'll meet later, these never switch case. Third, with a specific set of verbs that force Dativ on their only object, even though they might look like ordinary transitive verbs at first glance: helfen (to help), danken (to thank), gefallen (to please/be liked), gehören (to belong to), antworten (to answer). These verbs need to be memorized as a special list because they don't follow intuition — "I help him" feels like a direct object in many languages, but in German it's Dativ: ich helfe ihm, never ich helfe ihn.
How does the article change? The regular pattern is: der becomes dem (masculine), die becomes der (feminine), das becomes dem (neuter), and plural die becomes den, with an extra -n added to the noun's ending if it doesn't already have one (den Kindern).
A common mistake is translating "to" too literally with a German preposition, or defaulting to Akkusativ with verbs like helfen and gefallen because they seem transitive. Remember that this small set of verbs always demands Dativ and simply has to be learned by heart.