The biological bias comes first. Cultural, and in particular "origin stories" and similar constructs that communicate evolving cultural gender concepts to subsequent generations evolved later.
Manners of dress and speech, hair, correct social behavior and similar items are cultural and often enforced by embellishments of the origin stories.
We know that there is an intrinsic element to gender identity from the accidental work of Dr John Money. He followed patients who through medical accidents following birth underwent involuntary gender reassignment. The patients were reassigned as a result of botched circumcisions and similar mishaps, and their parents were directed to raise the child entirely in the reassigned told. The patients were followed for ten years and Dr Money determined that they were adjusted to their assigned roles.
Dr Money published a paper claiming proof that gender roles were entirely learned. This was immediately accepted by certain parts of the feminist movement that felt this was a scientific proof of equality. Gender as entirely a learned social role is still a common concept today in some circles.
A follow up on the patients in Dr Money's study, however, turned up some disturbing results. A significant portion of the patients detransitioned in their teens with some displaying suicidal ideation.
The best known of these is David Reimer, raised as Brenda. This is often referred to as the John/Joan case. It ended badly.
When researched independently, Dr Money's work demonstrated an innate component to gender identity, with the involuntarily reassigned persons often exhibiting symptoms we are all too familiar with.
https://en.m.wikipedia.org/wiki/John_MoneySent from my iPhone using Tapatalk