The short answer is that corrections occur when there is an aggregate of much more selling volume than buying volume.
What happened in December? Many investors, traders and institutions looked at all of the news out there and they ran for the door. Much of it was already known. Much of the reaction was the opposite of FOMO (Fear Of Missing Out). There were multiple signs that the economy could be weakening:
- Start ups were rushing to the market
- The market isn't cheap (total market capitalization near its highs)
- Many anticipated that earnings growth could be disappointing for the next few quarters, slowing from 3+ pct to 2 pct
- Deficits are significant, and could worse if a recession hit, limiting how much the Fed could stimulate the economy.
- Slowing global growth in China and Europe.
- Earnings have been propped up by share buybacks via cash on hand and new debt
- Trump’s trade tariffs cost the consumer $20+ billion dollars in 2018
- The yield curve inverted and that occurred before the last 7 recessions
- Fear that further aggressive Fed interest rate hikes could harm the economy
- US deficits are accelerating due to the Trump tax cuts
- The housing market was cooling
- Consumer confidence was declining
- The Purchasing Manager's Index (PMI) was declining
Factors like these factors do not guarantee that a recession will occur and as you noted, it didn't. The market reacts to a confluence of news and these issues can get worse or abate. It abated and the market recovered. Have many of these factors been resolved? Hardly any. They were digested and now it's business as usual until the herd gets spooked again.