... a star will become a red giant before it begins burning helium. In fact, it will bloat into a red giant while still burning hydrogen in a shell on the surface of the helium core. Shell burning, however, does release more energy than core-burning, but even that alone wouldn’t cause the star to become a red giant, since it could just shine brighter. The real culprit is the combination of the higher energy production rate AND that the star has a higher opacity at that stage in life. This produces an energy crisis where the energy cannot escape radiatively fast enough, and convection would have to be supersonic to rebalance the star. Since supersonic convection is highly disfavored (i.e. impossible), the star greatly expands to the point that the energy flux at the burning shell matches the energy flux at the now much larger surface again.
This is one of the best explanations I've found for how stars transition to red giants. However, the section I've bolded is confusing to me: why would the star become more opaque, and what causes that to occur?
It seems that shell burning and contraction of the no-longer-burning core of the star causes some expansion of the outer layers (this is described as the "mirror principle" and partly explained in lecture 12 (section 12.4). This causes the outer layers to cool, until H- ions start to form in them (around 5000K). These interact with light much more than neutral hydrogen atoms or bare protons (H+) which accounts for the increase in opacity.
The real reason stars bloat into red giants is not due to opacity changes, it is due to the creation of a degenerate core of non-fusing helium at the center. This degenerate core has a strong gravity, which dictates a high temperature to the hydrogen fusing shell that sits atop it. This is quite important, because when a star is undergoing core fusion like our Sun, the fusion rate self-regulates by adjusting the temperature. But when the temperature is dictated by the gravity of the degenerate core, it tends to be quite high, and the fusion rate, unable to self-regulate, goes nuts. Something has to give, because as said above, there is an energy crisis.
What gives is that the energy generation rate causes the envelope to expand, which lifts weight off the fusing shell. That reduces its density, and the amount of gas undergoing fusion. So unlike core fusion, which self-regulates its temperature, shell fusion self-regulates its amount of mass, by lifting off weight. But to lift off such a large amount of weight requires a very significant expansion of the envelope, ergo a red giant.
The H minus opacity near the surface does control exactly how large the star gets, because once the mass has been lifted off it doesn't matter so much to the shell exactly how far out it gets lifted. But it does matter to the star's ability to radiate that energy into space, so that controls the radius of the star, it just isn't what makes that radius large in the first place. So the reason the envelope expands in the first place has nothing to do with opacity, the opacity changes come into play after significant expansion has already occurred, and controls where the stellar surface ends up. If the stellar opacity did not change at all, it would still be a giant star, just not quite the same radius.