The higher prices consumers are paying for beef have their roots in decisions made by a million cattle raisers two or three years ago to cut back on the size of their herds because they were losing money.

Farmers sold for slaughter many of the cows they used for breeding and raised for slaughter many of the female calves (heifers) they otherwise would have raised to breed more cattle.

At first the farmers' actions to reduce the size of their herds increased the numbers of cows and steers available to be killed for meat. That further contained cattle prices and convinced even more farmers to sell their cows.

On Jan. 1 of this year there were 116 million head of beef cattle on farms and ranches, 16 million fewer than on Jan. 1, 1975.

Late last year, the supplies of cattle coming to market began to drop off and cattle prices began to rise. It only takes about three weeks from the slaughterhouse to the supermarket, so retail beef prices began to rise shortly thereafter.

According to the Agriculture Department, cattle prices were 32 percent higher in April 1978 than in April 1977, and Agriculture Department economist Dawson Ahalt expects cattle prices and retail beef prices to rise further.

Price increases for beef had been projected by the experts, but even the most experienced obsrevers are shocked by the size of the explosion since late 1977.

Retail beef prices, which fell most of last year, rose at an annual rate of 18.1 percent in the last three months of 1977 and at a 42.4 percent pace during the first three months of this year.

Ahalt said the expected decline in cattle cominb to market has been accompanied by two unanticipated developments: a surprising increase in consumer demand for beef and a decline in pork production. Pork prices have been rising as fast as beef prices.

Economists had thought expanded pork production would offset some of the decline in beef production, enabling enough consumers to shift to pork and keep price increases moderate for cattle.

For reasons they are at a loss to explain fully - among them cold weather, disease and low fertility among sows - hog output did not grow at the pace expected.

Richard A. McDougal a Nevada cattle feeder and president of the National Cattlemaen's Association, said cattlemen again are making money. Although herd size may decline a bit more this year, he said, ranchers will begin holding back heifers for breeding and start boosting the size of their herds.

A heifer cannot bear a calf for three years, so it will be four or more years before significant increases in the amount of cattle coming to market will occur.

McDougal said per capital beef production will decline 3 percent this year and more next year, but the expect prices to stabilize around June as consumers turn to beef substitutes.

The whole process is part of a 10-year cattle cycle that has played itself out seven times this century.

Prices rise because of depleted herds, causing ranchers to expand production. After several years that increased production begins to come to market slowly and depresses cattle prices until farmers start losing money, cutting back on breeding and depleting the size of their herds.