They are bearing *a* cost.
They hire a member of staff, they invest time into training that member of staff before they are fully productive. Then one day the member of staff is pregant and the following now must happen to the employer:
a) They must give the member of staff up to a year off work. They MUST keep the job open and they cannot replace the missing staff member on a permanent basis.
b) Therefore they must now hire a temp, and again bear the costs of training him or her on the job in question, companies internal processes and so on and so forth.
c) The woman can then, with a few weeks to go until they come back, decide actually they wont come back. They dont need to tell the employer this for almost a year.
d) This means the employer can often find themselves with just a few weeks notice to sort out replacement staff, etc etc...
All because somebody else decided they wanted to have a child. Somebody who, despite the inherent risk involved with employing a woman, the employer could not legally refuse to employ based on this risk.
This is a modern problem - many years ago people just didnt employ women for this reason. This, obviously was wrong, but now we seem to have gone the other way..