"Demography is destiny."

It's a popular phrase, but it's incorrect.

That was made apparent to me on a recent visit to Tokyo, where gray-haired individuals far outnumbered children in the streets. But the hustle and bustle also revealed that Japan does not accept that its aging population means its economic prospects must diminish. On the contrary, Japan is harnessing two of its assets — one long underutilized and the other a long-standing source of strength — to support continued economic expansion.

Japan certainly faces demographic challenges. It is already the oldest country in the world, as measured by both the median age of the population (46.3 years) and the share of the population aged 65 years or more (26 percent). That compares to just 40.4 years and 17 percent, respectively, among all high-income countries. And Japan's birthrate and inward immigration rate are low—as a result, the population is not only aging, but shrinking. Japan's working-age population peaked more than 20 years ago, in 1995.

And yet, Japan's economy is chugging along. It is by no means the fastest-growing major economy in the world, but it nonetheless continues to expand. In fact, Japan's GDP per capita growth averaged 1.42 percent annually over the last five years — slightly ahead of the OECD average of 1.36 percent.

As any economist will tell you, the two keys to sustained economic growth and higher living standards are increases in the size of a country's labor force and rises in those workers' productivity. Economies cannot grow in the long run without at least one of the two forces in play. In spite of its demographics, both forces are now propelling the Japanese economy forward.

How has Japan's economy remained resilient in the face of its demographic challenges? Sunday offers the answer: It's the International Day of Women and Girls in Science. Both aspects of what the world is celebrating today — women and science — are at play in Japan's economic resilience.

First, the Japanese government has actively sought to increase the size of its labor force by encouraging more women to work. Prime Minister Shinzo Abe's launched his "Womenomics" program in 2013, which has increased the rate of replacement pay for those on parental leave and expanded the capacity of daycare facilities. In addition, the government now requires companies with more than 300 employees to disclose gender diversity targets and associated action plans for achieving them.

In part due to those efforts, female participation in the labor force has risen from 65 percent in 2013 to 68.1 percent in 2016 — far ahead of the OECD average of 63.6 percent. That built on gains in previous years thanks to labor market reforms in the late 1990s and early 2000s.

These policies recognize the imperative to grow the country's workforce by harnessing the economic potential of women — a long underutilized segment of Japan's working-age population.

Second, Japan is leveraging science — more accurately, science, technology, engineering, and math (STEM), for which science is used as the shorthand in the name of Sunday's holiday — to boost its productivity. The country has long been a leader in technological innovation, but now its technological edge is helping the economy overcome so-called demographic destiny in two fields.

Automation and robotics are being utilized to enable greater levels of output with fewer workers. That is particularly apparent in the manufacturing and construction sectors. For instance, electronic parts maker Nidec is developing automating robots and an accompanying system of Internet of Things devices to improve efficiency and more easily adjust factory output to demand levels. And in construction, Taisei Corporation and the Chiba Institute of Technology recently introduced a robot that automates rebar binding — a process that normally accounts for 20 percent of the man-hours associated with constructing building frameworks.

Technology is also enabling Japan to better care for its expanding elderly population. Toyota is among the companies that have launched robots to help Japan's elderly people walk independently, while Panasonic has developed a bed that can split apart into a wheelchair.

Many companies have also developed companionship robots designed for the elderly, including Paro, a baby harp seal that nuzzles people who pet it, and Chapit, a mouse that chit-chats with bed-bound patients. Such developments not only solve for a shortage of workers in health care and elder care, but also enables younger family members to continue working rather than take time off to care for their aging relatives.

As we celebrate the International Day of Women and Girls in Science, it is worth keeping in mind the example of Japan. Demography is by no means destiny if a country has smart government policies and an innovative spirit. Other countries struggling with demographic or productivity challenges would do well to emulate Japan's winning formula.

Commentary by Paul A. Laudicina, the chairman of AT Kearney's Global Business Policy Council. He is a partner and chairman emeritus at AT Kearney.

For more insight from CNBC contributors, follow @CNBCopinion on Twitter.