More than 40 percent of American children are on public health insurance — mostly Medicaid and the Children's Health Insurance Program. This statistic is something of a triumph for public policy. Since 1989, the number of uninsured children has dropped from 15 percent to 6 percent, in large part thanks to the CHIP, which was spearheaded by the late Sen. Edward M. Kennedy (D-Mass.) (Hillary Clinton helped.)

Studies show that investing in health care for children delivers long-term benefits. As public health insurance expanded in the 1980s and 1990s, researchers found that children became become more likely to finish high school and college. They earned more as adults and paid more in taxes.

There’s another, less-comforting lesson we can learn from the government’s efforts to provide health care to every child. During emergency-room visits, children on public health insurance are less likely than children on private insurance to be admitted to the hospital.

This is not because poorer children visit different kinds of hospitals or because poorer children are less sick when they visit the emergency room. As Princeton economists Diane Alexander and Janet Currie show in a recent paper released by the National Bureau of Economic Research, hospitals just seem to prefer children with private insurance.

The researchers looked at hospital billings from New Jersey, which gave a complete record of children who visited any emergency room between 2006 and 2012.

They found that between similar children who show up at the same emergency room at the same time with flu symptoms, the one on public insurance was about 10 percent less likely to be hospitalized. For other kinds of health problems — asthma, dehydration and appendicitis are relatively common — children on public insurance were about 5 percent less likely to be hospitalized.

To be clear, none of these children were necessarily turned away. Hospitals still have an obligation to treat everyone who walks into the emergency room. But it seems that for borderline cases, hospitals were more likely to set aside a bed for a child on private insurance.

The disparity became particularly pronounced during peak flu weeks, when hospitals started running short on space.

This chart from the paper illustrates how the probability of getting a hospital bed changes for children on public health insurance depending on whether there was a flu outbreak in their area. Children between 2 and 10 years old who showed up at the ER with public insurance were roughly 20 percent less likely to get admitted during these peak times.

To see this on the chart, note the substantial gap between the dark-blue solid line and dark-blue dotted line. The dotted line represents the probability of getting a hospital bed during flu season. For children on private insurance, through, it didn’t seem to make a difference whether it was flu season; they were equally likely to be admitted.

This isn’t surprising, of course. Medicaid is famously stingy with its reimbursements, and as a result, many doctors are reluctant to accept Medicaid patients. It seems hospitals take the same approach.

“When the hospital has the capacity, then it will take both private and public patients,” the economists write. “However, when beds are in short supply, hospitals have a clear reason to prefer privately insured patients.”

The billing data show that when publicly insured children do end up hospitalized, they rack up more expensive charges than privately insured children. This suggests that publicly insured children have to be sicker before they can get a hospital bed. Yet, despite requiring more services, publicly insured children tend to be less lucrative for hospitals; they get much more money from children with private insurance.

In other words, the market can be cruelly efficient. Hospitals, like any other business, pay attention to where their profits are coming from.

But this tale, at least, ends in a happy twist. When Alexander and Currie went looking for evidence of harm, they could not find much. When publicly insured children were crowded out of hospital beds by flu patients, they did not seem any more likely to return to the hospital in the subsequent weeks. It did not seem that they were missing out on any essential treatment; it did not seem that their conditions had worsened.

Here was a finding that only a natural experiment could have produced. It’s unethical to interfere with children’s health care, but in this case, the flu season forced hospitals to triage their patients. The children who didn’t get hospital beds did not seem worse off — which suggests that many children are being over-hospitalized.

"Our results suggest that hospitals are more likely to admit children with private insurance than with public insurance when beds are scarce," Alexander said in an e-mail. "However, we find no evidence that this differential treatment translates into differential health outcomes, which raises the possibility that overall admission rates may be too high."

Hospitalizations are expensive, and health-policy experts have been trying to figure out ways to cut down on unnecessary stays. Now it seems that many parents may have been overly hasty taking their children to emergency rooms and that some children are staying overnight in hospitals when there really is no any medical necessity.