The cost of a dozen large eggs in California has soared, averaging about $4.50, up from $2.35 at this time last year. And the prices for any food that uses eggs as an ingredient, such as mayonnaise and baked goods, also are climbing.

What’s going on? This is a time of radical challenges in the chicken business. Farmers are coping with disease outbreaks and a high demand for corn, and the state’s new cage-free law — which has been copied by Washington, Colorado and several other states — is creating competition for a product that is already scarce.

Poultry expert Richard Blatchford has been watching these trends. The modern bird has come a long way from the wild jungles of Southeast Asia from which its ancestors originated some 8,000 to 10,000 years ago. Eggs and “broiler chickens” are now major commodities, providing the most popular and cheapest animal protein in the nation.

The Bay Area News Group asked Blatchford about the influences behind our favorite ingredient for omelets, soufflés, ice cream sundaes, McNuggets and more. His comments have been edited for length and clarity.

Q Why are California eggs so expensive?

A Part of it is general inflation. The cost of “inputs” — labor costs, feed, transportation and other factors — has gone up. Chickens eat a corn-based diet, so when grain prices rise, such as due to the war in Ukraine, which hampers the country’s ability to export, the cost of chicken feed goes up, as well.

Q What else is going on?

A There are two other forces that are really driving this increase in price and also egg availability.

The first is avian influenza, a highly contagious and deadly disease for poultry. We’ve had a massive outbreak of avian influenza this year.

The other issue is the implementation of Proposition 12. All eggs sold within the state of California have to be produced by hens that are housed cage-free.

Q Avian influenza is usually seasonal. Why is the current outbreak such a problem?

A This outbreak has been continuous. There has been no break since last summer.

One of the ways to try to stop that disease is to euthanize all of the birds in an infected area. You are required to kill all the birds in your flock. We have lost around 50 million egg-producing hens. That’s 50 million eggs — almost a day — that we’re not getting any more. There’s just been a quick fast depletion.

It takes time to replace those birds. Chickens don’t start laying until they’re about 18 weeks of age. So you have this period of time when they’re just growing. That will correct itself, eventually.

California hasn’t seen had a huge amount of avian influenza, thankfully. But the areas that are getting hit hard, such as the Midwest, have very large egg production. When their egg numbers go down, California’s egg numbers go down — because we import so many.

Q Why can’t we vaccinate chickens?

A If you vaccinate the birds, they test positive because they have antibodies. There’s no way to know: Did they naturally occur? Are they sick? International import-export regulations prohibit the movement of any poultry product that has antibodies.

Q Is avian influenza increasing the cost of our dinner table broiler chickens also?

A No, they don’t seem to have been hit as hard as the laying sector, which is probably just a matter of luck.

Their numbers haven’t dropped so dramatically that they haven’t been able to respond. The generation cycle of broiler chickens is also much faster. So it’s a little bit easier to replace birds. It takes about six weeks for a chicken to hit market weight.

Q How is the cage-free movement increasing prices?

A It has to do with labor costs. And with cage-free production, there’s a lot more to do.

A lot of poultry operations are automated now. For instance, in cage production, the eggs all come out onto a belt, and they’re taken to the processing plant. In a cage-free setting, there is a belt system, but the birds also lay elsewhere. So people have to go in and hand collect all of those eggs. It might only be a small percentage — but when a house has 120,000 hens, that’s a lot of individual eggs. It’s also a bit harder to do health maintenance checks on cage-free hens.

Q If other states follow our example and start producing cage-free eggs, will they be more abundant?

A I expect that the trend will continue to grow. But to meet all of the demands for eggs from companies like McDonald’s, about 75% of U.S. chickens need to be cage-free. I think we’re currently somewhere around 30%.

Q It sounds like there’s still a lot of competition for these eggs.

A We’re an egg-deficit state. California doesn’t produce enough eggs — we import somewhere around 60% of our eggs from other states.

That hasn’t been an issue prior to now because California had been one of the only states importing cage-free eggs. But there are now several other states that have come online with similar types of legislation.

There’s a small pool of eggs that has been made smaller because of avian influenza, and now there’s higher competition and demand for those eggs, because several other states also have cage-free laws.

Q We used to have plenty of eggs. Petaluma was once called the “Egg Basket of the World,” for its bustling egg industry. What happened?

A Some of it has to do with legislation and regulations. And some of it has to do with costs.

If you’re close to your food source, you can reduce the transportation cost. That’s why we see most of our egg production in the Midwest, because they’re very close to corn. It costs less than shipping corn out to the West Coast. In California, the vast majority of poultry production takes place in the Central Valley, between the Modesto and Fresno areas.

California used to be the No. 1 egg-producing state in the nation. Now it’s around the 10th.