When you visit a mosque you can see there are two different sections for women and men. Generally men pray in the front lines while women prayers are at the back or on the balcony. It may look like gender discrimination but the reason is more functional.
First of all going to the mosque to pray is not an religious obligation for women while men have to go there. Women also can pray at home because generally they are with kids and taking care of the house. Moreover for women if there is a special case like getting sick or need of visiting bathroom, they can easily go out from their section without disturbing all prayers.
It’s also believed that during the namaz (pray) men and women bend, kneel down and do some other physical activities. Keep them in different sections help people not to get distracted.
The reason why section for women is smaller than men’s is related to these circumstances.