It's not the unions themselves so much as the labor conflicts that can have this effect.
If a factory shuts down due to strike, it doesn't produce anything. If so, the price of whatever it would have produced goes up. Kind of like anything with chips in them when factories and supply chains were closed down during Covid.
And the problem with inflation caused by contracting supply, is that it MUST lead to reduction in aggregate consumption. But workers will typically react poorly to having to cut down consumption. Demagogues will argue that the "Fat Cat" capitalists has enough money to pay higher wages, as if more money leads to more consumer goods being produced. Still, union members tend to listen to the demagogues in time like this.
This leads to strikes, lock out, and reduction in production. Which intensifies supply side constraints and drives inflation further, leading to even more demand for raises, and so on, in a vicious circle.
This happens in a time where the West wants to repatriate strategic production from Asia, where there is a need to re-arm to meet growing security threats from China and Russia, where we're facing a huge wave of elderly that will want a massive increase in spending on healthcare and where the supply of younger working age adults is dwindling.
All these are factors that increase the demand for consumer goods and services (especially healthcare) and goods that compete with consumer good (like weapons) and where more of the goods will be built domestically (like chips).
So unless we can radically improve productivity, each person (on average) will be able to buy less than they're used to or expect.
Let's say there will be 10% less of "everything" available to consumers. Without unions, the market (and possibly government intervention) will allocate this reduction in real income relatively evenly over the population.
But it is kind of in the DNA of most unions to never accept reductions in real wages for the members. If we imagine that every worker was in a union, and everyone got a raise matching inflation from the previous year (including retired people), the new wage would still only allow the pupulation to consume the consumer goods that is actually produced. That would quickly cause prices to go up another 10%, again reducing purchasing power below what people are used to.
Now, add a few strikes into this. Let's say there is a general strike reducing economic output by 5%. This comes on top of the 10%, meaning that now 15% fewer consumer goods are available than people expect, causing prices to go up by 15% that year.
Now, if everyone tries to get back to their own level of consumption by loaning money, that's another 15% money chasing the same goods, which could lead to 30% inflation that year. To prevent that, central banks raise rates to, let's say, 15%.
As these rates enter morgage costs for middle aged people, the pain is magnified further, typically leading to more strikes, businesses going under (permanently removing them as a source of consumer goods), and so on. Unchecked, this can lead to hyperinflation.
Not that I expect it to turn out this bad. Demand is partly elastic. Some people WILL be willing to cut SOME consumption, especially if good investment opportunities open up.
Still, in a market where supply side output of consumer goods goes down by 10%, there exists a huge communication problem when trying to distribute this new reality to the population.
It can be done, though, especially during wartime, consumers may be able to understand that they simply cannot go on consuming as much as before. And if the consumers themselves understand it, the unions probably will too.
In peacetime it's harder, which we see if we look at what happened after the oil crisis in 1973, especially in the UK (where unions were very strong at the time). Labor conflict aggravated the already difficult situation, and played a part in the stagflation that would last for the rest of the decade and much of the next.
Eventually, it was brought under control, partly by new economic growth and partly by Thatcher crushing the strongest unions.
In the 1970's though, the west was in the middle of a demography-driven boom at the time, and with the boomer generation entering the labor market, growth was relatively easy to achieve.
Today, the situation is different. There are few young people to fill the jobs that retiring boomers are leaving. In Europe, the demographic development is more likely to cause economic contraction than growth. So unless something like AGI can cause a huge lift in productivity, we may actually face a long-lasting period where consumption has to stay at levels below what we're used to.
I expect it to take at least 10 years for that to sink in for most people.