When using compound words, their mean can still be retained when "de-compounding" them in one of two ways.
The first way: bookstore = store of books
For this compound word, one just adds an "of" in between the two parts of the word which were compounded and the words still retain the original meaning, however, this doesn't apply to all words. And for that there is the second kind of "de-compounding" word.
The second way: racehorse = Horse for racing
For this second way, it wouldn't make sense to say horse of racing because the horse itself isn't made of racing.
What is the name of this kind of distinction and why is there this difference within language?