جَاءَ زَيْدٌ الْكَرِيمُ: Zayd is the nominative subject; al-karīmu is its nominative adjective.
رَأَيْتُ زَيْدًا الْكَرِيمَ: Zayd is the accusative object; al-karīma is accusative too.
مَرَرْتُ بِزَيْدٍ الْكَرِيمِ: Zayd is genitive after bi-; al-karīmi follows in the genitive.
These are additional teaching examples: the governing role changes the first noun’s case; its adjective follows.