More specifically than Unions, it was the threat of violence (in extreme cases) and work stoppage by workers against the ownership class.
E.g. the Russian Revolution (one of the main workers' requests in the events leading up to the Revolution was the 40 hour work week and fair treatment).
The unions were just a symptom to mediate the threat of violence in exchange for a larger share of the added value generated by the worker.