My hypothesis would be that in times of economic instability (70's energy crisis, 2008 financial crisis) - people bias towards more obviously reliable fields for income and work (Nursing, engineering, etc.). It's also probably easier to major in CS (or some other technical subject) and take some humanities classes you find interesting rather than major in humanities.
A slightly more accurate model might be that demand for humanities degrees dries up when either students feel that they must get a STEM/professional/trade degree for economic survival, or that they should get a STEM degree to take advantage of a recent technological change. That accounts for the drop during the dot-com boom and during the mobile/crypto/AI boom that followed the financial crisis. At this point in time it's probably a stupid idea to get a humanities degree when all the jobs are in technology, and college students are simply responding to that.
This would also predict that as recent tech markets get saturated and stabilize, then assuming we don't have a major economic crash, you'll see humanities enrollment trend upwards again. Basically stability is good for humanities, but either too little or too much growth pushes people into STEM fields.