Functional, or grammatical, words are the ones that it's hard to define their meaning, but they have some grammatical function in the sentence. The, for instance. What does it mean? Well, that's hard to say. But its function is easy: it's the definite article. It makes things definite (says that you're talking about a particular instance of whatever follows). Or could - hard to describe its meaning, but its function is clear. Prepositions like on or at or if are also functional. Functional words are a closed class, which means we can't add new ones very easily. Try and remember the last time you heard a new preposition or article.
Lexical words, however, do have meaning: cat and armchair and toilet-brush and velociraptor all have clear meanings that you could describe to someone. They're also all nouns, which is one type of lexical word. Verbs can be lexical too, like fly, arrange and steal. Lexical words are open class, and we can make up new ones willy-nilly, by all the different word-formation rules we can muster. You can probably invent a new word now: just noun a verb or add -ify to something.
Did you know all that already? Maybe you did. If you think you didn't, well, I'm here to tell you that your subconscious knowledge of language includes this.
In The Jabberwocky, Lewis Carroll invents a whole stack of nonsense words. But every single one of them is a lexical word. If they weren't, you wouldn't be able to understand the poem the way you can.
I've emboldened the nonsense words in the first verse here, and they are all easily interpretable by the reader as nouns, adjectives and verbs (which are all generally lexical). The English words are all function words.
We can understand it because although we don't know what the unfamiliar words mean, we can recognise them for the right part of speech. We can tell that slithy is an adjective and toves is a noun. How? Well, there's a definite article just before that phrase, and we know that in English, a definite article comes at the start of a noun phrase. We expect it to occur with a noun, which we expect to find at the end of the phrase, and if there's another word in there we expect it to be an adjective and to come before the noun. We also know that nouns can have a plural -s ending, like tove-s, and that adjectives can have a -y ending, like slith-y.Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
The function words are what give us the sentence structure, so if you turn them into nonsense syllables, you're left with no clue. You've just got a string of words, some of which you know the lexical meaning of, but no idea how they fit together.
If you're still not sure that your brain knows this stuff, here's proof. I was watching an episode of slightly naff 00s game show 'Win, Lose or Draw Late' (presented by Liza Tarbuck) the other day (don't judge me, I like game shows, OK?). Paul Tonkinson, who had to draw the book title Life of Pi, began by drawing lines to signify the words in the title. He drew something like this:
____ __ ____Now, if he was representing the length of the words, he would have drawn the last one the same length as the middle one. But he didn't; it's clearly much longer. He is not representing the length of the words but rather their status as functional versus content words.