The WHY:

There are three roles men have in society: providing for women, protecting women and impregnating women. All of these have been partially or completely superseded by technology. Industrialization removed physical requirements from workplaces which means women can do any work that men can; women can already have children with each other(and the result is obviously always a girl); and military is moving towards standoff munitions and unmanned platforms, following the same trend as workplaces.

The HOW:

Men, in general, like women. They like being around women, they will give women preferential treatment if at all possible and they will generally listen to women and do what women say. Women, on the other hand, at best do not notice most men at all, at worst - and more commonly - they perceive most men as an active threat to their own safety. Social preference towards women is an estabilished fact. Plainly put, men are not needed and they are not wanted, and if women show them the door most men will use it.

The WHEN:

Thousand years, give or take. Obviously, large scale social change takes a long time.