Originally, I thought the Wortart for a word is determined by how it is used in a sentence. (I will limit this question to Pronomen, with some noun/verb/adjectives for motivation.)
In English, one can say
I drink the drink.
It is not sufficient to know the type-of-speech for "drink". The first instance is a verb, and the second is a noun.
(There are even examples of purposefully using a word as a different part of speech, as in
I have an ask to request from you.
Whatever one's feeling is about this kind of word (ab)use, it is undeniable that in that particular sentence "ask" is a noun.)
So I was surprised to see that "den" is identified as a Pronomen even in the sentence
Die Schüler haben den Ball gesucht.
[Richtiges Deutsch, Heuer et. al. p.111]
I guess I'm OK with memorizing the list of words that arr intrinsically Wortart=Pronomen, but that seems useless if there is no functional benefit to apply in actual writing/speech.
To highlight my confusion, consider
Rosa Einhörner fliegen schnell. Blaue fliegen langsam.
While it may not be ideal, I assume it is passable to write this in German. If so, what part of speech is "Blaue"?
Is Pronomen an intrinsic property of a word? ; of some words?