Historically businesses have been able to do this through a variety of workplace policies. Prior to the Equal Pay Act of 1963, discrimination was open and based on outdated and deliberate gender stereotypes. After the passage of the Equal Pay Act, companies had to "stack the deck" to retain these policies, largely as the act had holes within it that they could exploit. This was done via lower pay for women for the same job and isolation of women employees into low paying jobs/excluding them from high paid positions. Claiming men work more hours or have more seniority in their positions are other justifications, which can be difficult to verify.
Being a mother is another apparent way, as there is bias against working mothers and a lack of family leave policies, so many have to pay a stiff penalty in added costs to get daycare and babysitters, money which would otherwise been used traditionally, as with men's salaries.
In today's world, the pay gap is 79 cents for women for each dollar paid to men, so it very much still happens. Worse still, the 2014 number is higher for African-American (60 cents) and Latino women (55 cents) and it is getting worse over time, as they are victimized by both racism and sexism.