Heijunka is the levelling of production in both volume and mix, so a process runs at a steady rate rather than reacting to the immediate shape of demand.
It exists because demand variation amplifies as it travels upstream. A modest swing at the customer end becomes a larger one at assembly and larger again at the supplier, since each stage adds buffer against the variation it observes. The result is alternating overload and idleness at every level. Producing to a steady rate, with inventory absorbing the difference, stops the amplification where it starts.
Mix matters as much as volume. A month of product A followed by a month of product B is perfectly level in volume and violently unlevel in mix — every supplier feeding A sits idle while B runs. Levelling the mix means small quantities of each in repeating sequence, which is only affordable when changeovers are cheap. That is why Heijunka and SMED are almost always implemented together.
The trade is real: levelling requires holding finished inventory, which sits against the instinct to minimise it. A defined, visible amount of stock in exchange for stability across the whole chain is usually a net gain, but it is a genuine cost rather than a free improvement.