I had a similar question and someone said the easiest way to think of this is kind of like the difference between "they" and "them".
Rough example tied back to this exercise: - Correct: "How many of 'them' (filias) do you have?" - Incorrect: "How many of 'they' (filiae) do you have?"
Yes, the grammar behind it is that Latin uses different cases (= different forms) for nouns and adjectives depending on their grammatical function in the sentence.
"Filiae" is the nominative case, used for subjects. "Filias" is the accusative form, used for direct objects.
- How many brothers do the daughters have => "daughters" = subject => We use the nominative case => Quot fratres habent filiAE
- How many daughters do the brothers have => "daughters" = direct object => We use the accusative case => Quot filiAS habent fratres