Philosophy of language

A sentence containing “here” is spoken once in a library and once at a beach. Which distinction helps explain why the two utterances can concern different locations even though the sentence form is unchanged?