Qualify comes from Medieval Latin qualificāre — quālis 'of what kind' plus facere 'to make'. It originally meant to assign a quality to something. The modern sense of meeting a standard grew from the act of judging qualities.
To be entitled to a particular benefit or privilege by fulfilling a condition; to make competent or eligible; to modify or limit the meaning of a statement.
From Medieval Latin qualificāre meaning 'to attribute a quality to', from Latin quālis meaning 'of what sort, of what kind' and facere meaning 'to make'. To qualify something was to assign it a quality — to say what kind of thing it is. The shift to 'meeting a standard' came naturally: once you assign qualities, you can judge whether they are sufficient. The grammatical sense (a qualifying clause) preserves
Quality and quantity both start with Latin question words. Quality comes from quālis — 'of what kind?' Quantity comes from quantus — 'how much?' Both are from the PIE interrogative root *kʷo-. The Spanish word calificar (from the same root) means both 'to qualify' and 'to grade' — when a Spanish teacher marks homework, they are etymologically asking 'what kind of work is this?'