In a lot of languages everything has a base gender, and then the ablative case, accusative case, dative case, et cetera all have their own rules.
It's just a matter of memorizing the rules and then memorizing the noun's gender.
I'll use Latin as an example because it's what I know. Girl is Puella, and the plural is always -ae for female nouns in the nominative case. However the neuter ending -um is used for a lot of masculine -us words, so there may be more to it in German than just using feminine endings for plurality. It may seem like plural is always feminine, when it might be a single case you're hearing.
I don't think there's a strict rule they used to assign genders, I think it was more common sense or personal preference. Things like houses are usually feminine while rivers may be masculine.
I don't think I answered your question.
