Hello! Another Jew here. Raised Modern Orthodox, moved over to Reform when I married out, because I wanted to join a community that would completely accept my dh.
My family were wig-makers in Poland for several generations, and my dgm told me that the shaving thing began because in the 16th century the Polish nobility practiced droit de seigneur, ie they could demand to sleep with any bride on her wedding night. So it became the practice among Jews in the little villages where they were vulnerable to the local squire's fancies, to shave the bride's head immediately after the ceremony in order to make her less attractive to the squire. But, to avoid humiliating her, she would also be given as realistic and beautiful a wig as possible.
Afterwards, she might let her hair grow again, and simply wear a scarf. But she rarely let her hair grow very long, because the wig would be uncomfortable over long hair. As a wig is a huge investment, she would have kept it for 'best'.
Covering one's head is considered a sign of modesty and of humbleness for both men and women in Judaism. On top of this, a woman's hair is considered sensual and beautiful, and should therefore only be seen by her husband once she is married. But that just leads to covering, not shaving.
Over the generations, a practice that evolved out of desperation became established norm, even when it was no longer necessary. Men decided that a married woman with long hair was immodest - even if her husband was the only man who saw it. Other women would see it and could be influenced.
Not all Orthodox women shave their heads, and not all wear wigs (though all cover outside the home and among unrelated men).
The religion being matrilineal also evolved out of response to abusive and misogynistic practices outside Hewish control. Originally Judaism was passed down the father's line, but after the Romans evicted the Jews from the Land of Israel in the 2nd century CE, Jews became very vulnerable with no homes or defences. Rape of women by outsiders became more common. Under these circumstances the identity and status of the father couldn't be known for sure, but you could be certain of the mother. In order to keep the children within the Jewish community, transmission of the religious status became matrilineal.