There are economic success stories, and then there are economic miracles. Indonesia, the world’s fourth most populous nation, saw truly miraculous growth in recent decades.

In just 15 years, the country’s gross national per capita income has soared from around $2,500 to roughly $9,500. In addition, the Indonesian economy is on pace to reach $1 trillion by next year, up from just $114 billion in 1990, according to the World Bank.

Much of the tremendous growth has come from favorable trade flows with China, its largest trading partner. Yet the Indonesian economy has grown large enough to escape from China’s shadow, and the markets are now decoupling. For example, Chinese stocks are soaring this year, but the Jakarta stock market index is off more than five percent thus far in 2015.

As a result, it’s no surprise the three equity exchange-traded funds focused on the country––the iShares MSCI Indonesia ETF (EIDO), Market Vectors Indonesia Index ETF (IDX) and Market Vectors Indonesia Small-Cap ETF (IDXJ)––all hit 52-week lows during the past two weeks.

The disconnect between Indonesia’s bright economic future and the current malaise in Indonesian equities is the inevitable result of a fast-growing economy that eventually induces bottlenecks. These days, Indonesia is wrestling with a strained infrastructure and a sclerotic bureaucracy. Tackling those challenges will be crucial as Indonesia seeks to rev up its growth engine.

After some recent downward revisions, the Indonesian economy is now expected to grow around 5 percent this year. That’s a growth rate that Western economies would envy, but marks the lowest growth rate for Indonesia since 2006.

Much of the blame can be pinned on troubled commodities markets, as Indonesia is a key exporter of coal, palm oil, copper and other industrial raw materials. Yet economists also have concerns about government policies and their impact on growth.

Indonesian Prime Minister Joko Widodo came into office last summer amid high hopes for reform. Widodo is the first leader in Indonesia’s young democracy that doesn’t hail from the established military or political elite.

His policies are being closely watched by Glovista Investments, an emerging markets-focused investment firm. “We are looking for emerging market economies where governments are pursuing reforms,” says Darshan Bhatt, Glovista’s deputy chief investment officer. He notes that Vietnam is also an appealing opportunity in that respect.

Indonesia’s new prime minister is still trying to gain traction with his reform agenda. iShares’ investment strategist Tushar Yadava notes that Widodo’s reform agenda is on ever weaker footing. “Falling approval ratings do not engender support at a time when it’s needed most,” he says.

Widodo is trying to close a budget gap, shore up foreign reserves, and replace the hole left in the economy by falling commodity prices. On the plus side, stable debt and a fast growth rate means Indonesia’s debt-to-GDP ratio has fallen by half in the past 15 years, to around 30 percent.

Another plus is the Asian Development Bank (ADB) sees inflation dropping 1.5 percentage points next year, to 4.0 percent, thanks to falling oil prices. That is expected to lead to a series of central bank interest rate cuts, which should help to offset current economic headwinds.

Near-term headwinds aside, the Indonesian economy is expected to see economic growth accelerate to 6.0 percent next year, according to the ADB. And that can be chalked up to demographics.

The number of people living in poverty has fallen from 18 percent in 2006 to around 11 percent today, and many of those people are joining the middle class. For a country with 250 million people, that creates a powerful backdrop.

Bhatt at Glovista Investments believes the country has a strong chance to develop a robust consumer economy. 

Morningstar’s Patricia Oey says domestic consumption now accounts for two-thirds of Indonesia’s gross domestic product, which dispels the notion the country is primarily a commodities producer. The ETFs that focus on Indonesia appear well-suited to capture any further gains in domestic consumption.

The iShares MSCI Indonesia ETF is based on a cap-weighted index that is heavily skewed towards the financial sector (40 percent), consumer discretionary and staple stocks (30 percent), and telecom services (11 percent).

Over time, the Indonesian stock market—and the ETFs that follow it—should become more broad-based, thanks to reforms and privatizations. “Smaller enterprise and non-national domestic industry often follow after the nationalized institutions are deregulated or become more open to competition,” says Yadava from iShares.

The iShares fund, which carries a 0.62 percent expense ratio, has lost roughly five percent of its value annually over the past three years, reflective of the country’s economic growing pains. Bhatt says that the underperformance means that “valuations have become attractive again.”

Investors may also want to consider the Market Vectors Indonesia Index ETF (IDX), which sports a slightly lower 0.58 percent expense ratio. This fund has a similar sector weighting as the iShares fund, though the Market Vectors fund deploys a set of rules that slightly limits large-cap exposure. The typical holding is roughly 10 percent smaller.

Market Vectors also offers the Indonesia Small-Cap ETF (IDXJ), though that fund currently has a small asset base ($8 million), small trading volumes and wide bid/ask spreads, making it best suited for long-term investors. The fund's expense ratio is 0.61 percent.

Investors who were wise enough to invest in Japan in the 1960s, South Korea in the 1980s or China in the past decade scored huge gains for one basic reason. Namely, those economies put the foundation in place to build a thriving middle class, which established a self-sustaining pattern of rising domestic consumption. Indonesia appears to be following the same playbook, and long-term investors could reap significant gains as a result.