While consumers have been enjoying cheap eggs from the grocery store, the opposite can be said for Cal-Maine Foods (CALM 1.02%), which hasn't been enjoying the pricing environment. The largest producer of fresh shell eggs in the U.S. shot to record highs in 2015, only to slowly decline in price ever since. The culprit for the epic rise and fall? The volatile nature of egg prices.

CALM Chart

Data by YCharts.

A two-year egg industry history

Commodity prices are volatile. Seasonal changes and small fluctuations in supply and demand for the most basic of items can result in wild swings in prices. Such is the case with agricultural products, eggs included.

A closeup picture of a flock of brown hens.

Image source: Cal-Maine Foods.

In the spring of 2015, egg prices soared to record highs due to the outbreak of avian flu in the Midwest that reduced supply. The disease killed tens of millions of birds and reduced the size of national hen flocks by 12%. Farms affected by the outbreak struggled, but unaffected producers enjoyed the higher prices received from distributors and grocery stores.

Those high prices didn't last forever, though. As the epidemic abated and supply returned to normal levels, egg prices steadily declined and hit a decade-long low in late 2016. The boon to business enjoyed by some farmers suddenly came to a screeching halt.

Putting Humpty Dumpty back together

Cal-Maine was one of those egg producers with no reported outbreaks of flu, and the record-setting egg run provided a big boost for the company. The reversal over the last year has hurt, though, and has demonstrated that the company's fate is ultimately linked with the price of eggs.

CALM Revenue (TTM) Chart

Data by YCharts.

As egg prices have retreated, sales and profitability have followed suit. The company has been running a net loss for the last three quarters, which has hastened the share price decline in another way.

Cal-Maine's dividend policy is to pay out one-third of net income to shareholders each quarter there is a profit. With the situation as it stands, investors haven't received a dividend since the first half of 2016. Once the company returns to profitability, the policy is to wait on the dividend until a second consecutive quarter of profits rolls in. That means that, at the earliest, no dividends will be paid out until this summer. That best-case scenario is if Cal-Maine reports a profit on March 27 when it reports its third quarter and another profit when it reports three months later.

With egg prices still near multiyear lows, don't hold your breath for that best-case scenario to transpire.

Forging ahead with consolidation

In spite of the egg industry's difficulties, that doesn't mean all is lost. Cal-Maine is betting egg prices will eventually recover and continues to execute on its stated expansion efforts. That strategy includes buying existing egg farms and building new ones.

The company has acquired 19 competitors since 1989, with two of those purchases being made in the last six months. In November, the acquisition of Dixie Egg Company from Foodonics was completed, and a few weeks ago the purchase of Happy Hen Egg Farms was finalized.

A picture of thee cartons of eggs from Cal-Maine: Farm House cage-free eggs, 4-Grain organic eggs, and Egg Land's Best farm fresh eggs.

Image ource: Cal-Maine Foods.

Through growth and acquisition, Cal-Maine has grown to control about one-quarter of the U.S. egg market. That growth in market share could help Cal-Maine control egg supplies going forward and potentially help stabilize prices. Going beyond just supply control, the company is also placing bets on "specialty eggs," which include those deemed cage-free and organic eggs.

The company cites better margins and lower price volatility as a reason for the investments, but it's a growing trend in the food industry that is tough to ignore. Consumer attention has been directed at inhumane conditions for farm animals, egg-laying hens included, and even McDonald's picked up on the trend when it announced it would transition to cage-free eggs last summer.

In the meantime, though, it is hard to envision a quick recovery for Cal-Maine without egg prices rising. That has begun to happen in recent months, so investors should tune in to earnings results the next couple of quarters to see how that translates into profitability.