Linguists class words as either concrete or grammatical. Concrete words represent objects, actions, feelings, etc - things that can be named. Imagine two people sitting under a tree in the African savanna 100,000 years ago inventing words for the first language (that's not how it happened by the way). We can understand how words might have been made up for animals, stones, sun & stars, even feelings like hot and tired. These are concrete words (nouns, verbs, adjectives, adverbs). It is harder to imagine how they would have come up with words that we use to tie these concrete words together into meaningful sentences. Words like "and", "but", "the", "for", etc. These are called grammatical words because they form a language's grammar (prepositions, articles, conjunctions, interjections, auxiliaries).
Linguists believe that most if not all grammatical words started out as concrete words which later began to be used in a different way. An obvious example is the number one being used as the article "a". In French it is the same word "un/une". A more interesting example is the French word pas (pronounced pah - the French are even worse than English for not pronouncing all their letters). [Since my French is quite rusty, I will use the examples from McWhorter's Lecture 4 in The Story of Human Language DVD.]
Pas is a concrete word meaning "step" which developed into a grammatical word meaning "not". Originally in French "He does not walk" would be "Il ne marche". For emphasis one could say "Il ne march pas" - "He doesn't walk a step". Similarly "Il ne mange" (He doesn't eat) could be said "Il ne mange mie" (He doesn't eat a crumb) and "Il ne bois" (He doesn't drink) as "Il ne bois goutte" (He doesn't drink a drop).
As time went by, the emphasis became weaker (like the word "awesome" which used to mean something really spectacular and can now be used to describe a salad) until the added "step", "crumb" or "drop" no longer made any real difference in meaning, and were dropped from usage. All that is, except for the word pas for step. It not only hung in there for not walking but began to be used for all negative actions. "He doesn't eat" became "Il ne mange pas"; "He doesn't drink" became "Il ne boit pas", etc. This is how I was taught French 40+ years ago.
Completing the process, in modern spoken French the "ne" is no longer used, leaving only the "pas". So to continue with our examples of not walking, eating or drinking, we now have "Il marche pas", "Il mange pas" and "Il boit pas" where the word for "step" is the only negative.
A familiar example in English [from The Unfolding of Language by Guy Deutscher] is the verb going to which means "moving yourself to" but has taken on an element of a future tense. Consider: "I am going to the store. When I get to the store I am going to buy a book." Interestingly the "going to" in the second sentence can be shortened to "gonna" but the "going to" in the first cannot. So the slang word gonna has developed only for the future sense of "going to" not the original travelling sense. In the future should gonna become accepted as "proper English" it will be a new grammatical word. With further changes it could eventually morph into something unrecognizable from its original "going to".
Transitions like this have created all the grammatical words we now use not only in English but all languages. Fascinating!