In any language, not only in English, word stress and sentence stress are used to sound musical and to mean more than the literal meaning.
In general we stress on one syllable in one word. If we stress on the first syllable ("pre"), it could mean usage of the word "present" as a noun. We use stress second syllable "sent" of the word, it could be used as a verb.
For long compound words like overflow (verb), the stress is on the second word "flow". If it is a noun, the stress could be on the first word: greenhouse.
The rules have lot of exceptions. It takes time and experience to all the stresses, rules and exceptions.
Sentence stress: the words that carry the meaning - semantic - are stressed. this is to convey more effectively to the listeners. So nouns, verbs, negatives (don't etc), adjective and adverbs are stressed.
Other words in a sentence that help the structure of the sentence - contribute to the grammar - are not stressed much. Like, pronouns, auxiliaries, conjuctions (and etc. ), and articles (a,an,the) are not stressed.