Primarily.
Not irrelevant but secondary.
Well again, todays human societies are patriarchal. Almost exclusively. Those that are not are those Western societies that have estabilished an equalitarian standing before law. This is the first empirical observation.
Historically, societies have been patriarchal. If matriarchal societies ever existed they did not survive the test of time, they were eliminated by what we could call Darwinian selection.
We can also empirically observe that gender roles through history maintained specific grandlines, with particular variations according to the society but grandlines nonetheless.
The gender role of the woman in patriachal society is and has always been that of homemaker, which is primarily result of the natural predisposition.
The role of man can be defined in two grandlines: provider and protector, this is in every society, from Aztecs to Sumerians, with their own variations but in every society nonetheless. And that is once again result of a natural predisposition that man have and that is the one of strenght/violence.
Let's move to the counterproof of my argument. Western societies are the first ones shifting away from patriarchal roles, and they are also the first ones where physical strenght has lost a significant part of its relevance. With the natural predisposition of men becoming less significant, the gender role of provider becomes available for women too.
The conclusion is self evident. Genders are developed by giving the best answer to human needs according to human natural skills.