Semantics refers to the literal meaning of language as found in dictionaries, while pragmatics considers the intended meaning based on context. Pragmatics studies how the meaning of an utterance depends on the physical, epistemic, linguistic, and social context rather than just the words themselves. It recognizes that the same words can communicate different meanings based on factors like tone of voice, facial expressions, prior discussions, and the relationship between the speaker and listener.