Japan has a major demographic problem: 26 percent of its population is elderly, the largest percent of any country in the world. That's because Japan's birthrate is declining, as is its overall population. In other words, a huge chunk of its population is getting old and leaving the workforce, and not enough people are being born to take their place.

It's hard to appreciate the scale of this crisis — and it is a crisis — abstractly. Which is why this eye-popping chart, from a new report by the Organization for Economic Cooperation and Development (OECD), is so helpful. It shows the percentage of Japan's population that's elderly (green), working-age (blue), and too young to work (red), estimated all the way out to 2050. What you see is a massive rise in the percentage of elderly in Japan at the expense of the other two categories:

By 2050, the OECD projects, nearly 40 percent of Japan's population will be elderly.

This is very, very bad: Countries need new people to support the older ones who can't work and to generate economic growth. If Japan doesn't turn its birthrate problem around, or somehow make each of its workers a hell of a lot more productive, it's in for a disaster.

"The working age population is falling by about 1 percent per year, and the rate of shrinkage will eventually approach 1.7 percent per year, so that even productivity growth of two percent or more will deliver very low aggregate or per capita growth," the OECD report explains. "There will simply be no way to sustain high living standards and quality public standards in a 'super-aging' Japan unless the country is able to achieve much higher rates of productivity growth."

How did this happen? Partly, it's that Japan has some of the longest life expectancies in the world, so its old people are living longer. But Japan's low birthrate — one of the lowest in the world, in fact — is the biggest reason. And for that, we can place a lot of the blame on one of history's greatest villains: sexism.

Japan forces women to choose between work and children

The core reason for Japan's problem is that the structure of the Japanese economy forces women to make a terrible choice between having a career and having children. Many are choosing their careers, which means the country is simply not having enough babies.

The difficulties for women in the Japanese labor market can be traced to three core elements of Japan's economy that have been in place since World War II: lifetime employment by one company, payment based on seniority, and unions with memberships from one company rather than from an entire industry.

These "Three Treasures," as they're called, are great for workers who already have good jobs, but they hurt people who want to switch jobs or who take significant amounts of time away from work. Japanese workers work some of the longest hours in the world, and are expected to develop what are called "firm-specific skills," such as learning the company's particular way of accounting or developing personal relations with its clients.

Women who take time away from this intense schedule for pregnancy or child care often lose their jobs. "In a low-mobility labor market, job loyalty is at a premium," Yale University's Frances McCall Rosenbluth, an expert on gender and the Japanese economy, told me. "Because employers are stuck with whomever they hire, they want to hire people who are going to be productive."

The result is that women face deep discrimination in the workplace. "Japanese firms don't even really like to hire women," Rosenbluth says, "because women are a less safe bet."

Japanese working mothers make 61 percent less than Japanese working men. The gap between the percentage of adult men who work and adult women who work is about 24 percent.

Nonetheless, more and more Japanese women want to work: The female labor participation rate has spiked in the past few decades, even though it still lags behind developed-world standards. Japanese women have often accomplished this by giving up on motherhood —hence the declining birthrate.

"You would think that if they can't get into the job market, they'll stay home and have kids," Rosenbluth says. "But that doesn't work if the women who are discouraged in the labor market are more committed to the labor market than they are to the prospect of having a family."

One fairly obvious way to alleviate this problem, at least partially, would be to have Japanese men assume some of the responsibilities of child rearing. If both men and women are taking time away from work for child care, the playing field gets a bit more even. But that's not happening, due in large part to the strength of "traditional" gender norms in Japanese society.

Just 2.3 percent of Japanese men took paternity leave in 2014. (By contrast, roughly 90 percent of Swedish fathers take paternity leave.) Japanese fathers spend considerably less time with their kids than do fathers in other developed countries, and much less time than Japanese mothers. The number actually declined from 1994 to 2005, suggesting that the trend is toward fathers spending less time at home and leaving mothers with a larger burden, rather than the reverse.

This isn't just a problem in Japan: A number of wealthy countries, including South Korea and Germany, are experiencing lower birthrates and aging populations for fairly similar reasons. But the birthrate situation is much worse in Japan than in most places, due to the country's Three Treasures system as well as other factors, like its very low level of immigration. This means Japan is a sort of trial run for sorting out this problem.

And one key barrier to overcome, without question, is ending the de facto punishment of Japanese working women who choose to become mothers.

Go deeper: