Chess game is dominated by men players so gender-divided rankings and tournaments are there to encourage and promote chess amongst girls and women.
As there are very few female chess players in comparison to men, the said factors contribute to creating female role models, female champions, etc. It’s not meant to discriminate but to promote chess amongst girls, especially because it might be somewhat intimidating to enter a sport mostly dominated by men.
There are many tournaments in which men and women compete against each other. Right now you are not seeing women compete against the best men chess players in the world because there is no women players right now who is in the top 20 ranking of chess.
In the 90s a female GM, Judith Polgar, ranked among the top 10 best chess players in the world, played against the likes of Kasparov, Anand, Karpov etc.
There’s actually a women’s World Championship, and an Open World Championship (which any human can enter). Theoretically, a woman could win the open world championship and win it.