To qualify is to answer a question. The word comes from Medieval Latin qualificāre — quālis ('of what kind?') plus facere ('to make'). To qualify something was to say what kind of thing it is — to assign it qualities.
The Latin quālis was an interrogative adjective: 'of what sort?' Its answer produced qualitās — 'a property, a nature, a kind'. Cicero is credited with coining qualitās as a translation of the Greek poiotēs, Aristotle's term for the attributes of a thing.
When English adopted qualify in the 16th century, it carried both the descriptive and the evaluative sense. To qualify a statement was to describe its limits — to say what kind of claim it really was. To qualify for a position was to demonstrate the right qualities. Both senses survive.
The grammatical meaning is closest to the original. A qualifying adjective tells you what kind of noun you are dealing with. 'Red car' qualifies car — it answers the Latin question quālis? Of what kind? Red.
The family extends further than expected. Quality and quantity are parallel formations from parallel Latin questions: quālis ('what kind?') and quantus ('how much?'). Both interrogatives descend from the PIE root *kʷo-, the same root that gave English who, what, when, where, and which. Every question word in English traces back to the same ancient interrogative impulse.