The understanding comes from knowing when to use that phrase compared with other phrases that might mean similar things. Idiomatic usage to some extent. If learning a language was just remembering direct phrases then machine translation would be trivial