I think you will find equal pay and non-descrimination has nothing to do with unions but it is federal law. Unions once had a very important place in this country but they overplayed their hand to the point that they destroy industries and cause many people to lose jobs. The steel industry, airline industry, the American auto industry are good examples of what unions can do to you.
I think you will find equal pay and non discrimination clauses in union contracts before the federal government got around to it. Did you ever see the white guy in the front row of the sixties civil rights marches? That was Walter Reuther.
Foreign dumping of steel and autos along with currency manipulation are two big reasons for the decline of both American industries. The bottom line is that foreign governments have heavily subsidized their export industries. We have thrown ours overboard in the name of "free trade."