The above is sort of a lie -- in the case of the tech industry, there is a lot of competition for workers. Since everyone wants to hire SWEs, I have more negotiating power than other industries. If Google doesn't hire me, I could (presumably) get a job at Amazon, Facebook, a startup, etc.. Since I could find other offers, I wouldn't have much to lose if I don't take Google's offer, and Google will therefore have an incentive to offer me better comp. Because of the above, it's not clear to me that tech workers need a union right now.
In other industries, labor is a buyer's market. If there is only one or two employers in a region, then those employers can choose to not hire any one laborer. Not hiring one laborer might mean that an employer's capital is deployed slightly inefficiently, which is again unfortunate, but nobody will lose sleep over it. But since that one laborer has no alternatives, they must work for a lower wage or risk destitution. This is a big problem in academia, where it's very difficult for grad students to switch schools (admissions offices reduce student mobility) and there is only one employer -- the school.
So unions are not analogous to cartels for selling labor -- they are not necessary when there is a balanced labor market, like in tech. But for markets which favor employers, they may often be necessary to protect workers.