Partly true. The gender pay gap is essentially an average of the salaries of all the men vs all the women. It does not take into account time off, age, job type, etc etc.
It is literally an average of a million men vs a million women.
What people often fail to realise is that men choose to do higher paying jobs. Jobs that are dangerous, dirty, require strength... electricians, builders, sewage workers, military, police, oil rigs, on trawlers, security, hazardous waste, nuclear power stations...
I know guys in all of these roles, I don't know any women. Yes, there may be some companies with a pay gap, but the pay gap that everyone is familiar with is simply an average of all jobs, and for that, if men are more likely to risk their health and lives, shouldn't that be fairly compensated?
(This is perhaps a discussion for its own thread!)