The bull market in stocks over the past four years has been the greatest gift that many retirement investors could ever have asked for. Pulled back from the edge of a financial precipice they might never have recovered from otherwise, disciplined investors have seen their retirement accounts recover most or all of their losses during 2008's market meltdown, as gains of around 100% for the Dow Jones Industrials (DJINDICES:^DJI) and the S&P 500 (SNPINDEX:^GSPC) have boosted the fortunes of those who stayed invested in equities.

But a massive sell-off for the Dow following the election has raised the specter of an end to the bull run. The last thing investors want to do is ride their hard-earned gains all the way back down again. Will buy-and-hold followers end up all right, or will the market punish them for their adherence to a long-term investing view?

Record retirement balances
Before the recent market turbulence, the financial health of American workers appeared to be better than ever. According to a recent report from Fidelity Investments, which administers roughly 12 million accounts for more than 20,000 company retirement plans, the average 401(k) balance hit $75,900 in the third quarter, the highest level since Fidelity started tracking its 401(k) balances 12 years ago. That average represents a better than 4% increase since the second quarter and an 18% boost from a year ago.

Similar figures from Vanguard confirm Fidelity's findings. Vanguard's average 401(k) balance rose to $85,330, also a record high since Vanguard started looking at its figures 14 years ago.

What's behind the gains?
Certainly, a favorable market has helped push 401(k) balances higher. With the S&P up 27% over the past year and bonds also seeing solid gains, investors who had their 401(k) money in just about any type of investment other than cash definitely had the winds at their backs.

But if the recent swoon in the Dow turns out to be the beginning of a bigger downward move, will those gains go up in smoke? The answer is probably no, because the market can't take all the credit for rising 401(k) balances.

Contributions to 401(k)s are also responsible for much of their recent growth. Encouragingly, Fidelity found that both workers and employers alike are doing their fair share in boosting 401(k) balances by increasing their respective contributions to their retirement plans. Employees now contribute an average of 7% more to their 401(k) accounts than they did five years ago. Moreover, employers are pitching in, with a 19% jump in the amount they're setting aside on behalf of their workers in the form of profit-sharing contributions and employer matching.

At least on the worker side of the equation, automatic enrollment and escalation programs are behind some of the increased savings rates. But interestingly, Fidelity found that workers tend to save more when they aren't automatically enrolled in a plan, setting aside more than twice the percentage of their salary as plans featuring auto-enrollment. The report blames the disparity on plans setting default investment rates too low, with 3% being a typical level.

The real threat to your retirement
Clearly, falling markets reduce 401(k) balances. But over the long run, ups and downs in the market tend to even out. If you keep contributing to your retirement account, the odds are a lot better that your balance will recover more quickly from occasional market dips.

The bigger reason for concern, though, is that market weakness may indicate falling corporate earnings down the road. During the last recession, Ford (NYSE:F), United Parcel Service (NYSE:UPS), and FedEx (NYSE:FDX) were among dozens of companies that temporarily suspended 401(k) matching contributions until times got better. Given how essential employer matching and profit sharing have been in restoring retirement plan levels, any danger of seeing them disappear again is cause for worry.

So if you're using your 401(k) to save for retirement, don't fear the Dow's recent drop. But keep your eye on earnings at your employer, because losing benefits like employer matching and profit sharing could have a bigger long-term impact on your retirement prospects.

Fool contributor Dan Caplinger has no positions in the stocks mentioned above. The Motley Fool owns shares of Ford and FedEx. Motley Fool newsletter services recommend Ford, FedEx, and United Parcel Service. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.