It is held widely by governments, central banks and private institutions to conduct international trade and financial transactions.
Other major reserve currencies include the euro, Japanese yen, Swiss franc, British pound, Canadian and Australian dollars, and the Chinese renminbi.
One of the foreign exchange earners is exports - either goods or services.
Kenya's major exports include tea, coffee, flowers, vegetables, fruits and titanium, which together earned the country Sh207.8 billion in the first three months of this year compared to an import bill of Sh591.6 billion, official data shows.
Other sources of foreign exchange reserves include diaspora remittances, tourism, and foreign investment, among others.
Just like Sri Lanka, Kenya's fraction of expensive commercial loans has been growing steadily, though it is not as high as that of the Asian country, which stands at 47 per cent compared to Kenya's at 26.3 per cent.
In 2013, commercial loans only took up close to 2.2 per cent of the total external loans.
Expensive loans have meant that much of the taxes are going into paying debt, crowding out other critical public services such as security and paying doctors.
By the time outgoing President Uhuru Kenyatta came to power in 2013, for every Sh100 that Kenya Revenue Authority (KRA) collected, only Sh15 was used to repay interest on the debt.
But this has since more than doubled to Sh32 being used to pay interest by the end of June 2023, data from the National Treasury shows.
Interest payments are paid regularly, twice a year, and have grown from Sh121.1 billion to Sh687.9 billion by the current financial year.
And as the country was hit by the Covid-19 pandemic, affecting export and tourist earnings, the International Monetary Fund (IMF) increased the possibility of the country defaulting from modest to high. But can Kenya go the Sri Lanka way?
Unlike Sri Lanka, which has already defaulted on its international loans, government officials insist Kenya is yet to default on its debt payments.
"You can always go to the Sri Lanka situation," says Wahoro Ndoho, an economist and public finance expert. According to Mr Ndoho, Sri Lanka is a classic example of politics adding fuel to the fire.
Stay informed. Subscribe to our newsletter
Even before the Covid-19 pandemic gutted Sri Lanka's foreign exchange reserves, President Gotabhaya Rajapaksa, in a bid to be re-elected, cut taxes by 25 per cent to entice voters.
The cabinet approved a cut of value-added tax (VAT) to eight per cent from 15 per cent, removed withholding tax on interest, a debit tax and halved income tax on construction companies.
A capital gains tax on stocks, a debt tax on financial institutions and a debt service tax have also been removed.
The pay-as-you-earn tax deduction from monthly wages up to rupees 250,000 has also been removed.
A telecommunication tax that was in place was also cut by 25 per cent. There were also a series of import tax cuts.
"Kenya has gone the opposite direction as far as revenue generation is concerned," says Mr Ndoho, adding that Kenya has been looking for more revenue.
A combination of factors, including the neglect of the agricultural sector, with the country increasingly relying on the importation of foods, as well as the emerging issues such as the Covid-19 pandemic and the Russia-Ukrainian war, have combined to push up the cost of living.
A spike in prices of major commodities in the global market has also resulted in a rise in the cost of living, with prices of goods and services increasing by 8.5 per cent, the highest since June 2017.
Some of the items that contributed to the rise in prices include mostly food and fuel, which take up the largest space in the shopping basket of a typical Kenyan.
They include maize flour, maize grain, white rice, carrots, laundry soap, paraffin, diesel and petrol.
There are several similarities between Kenya and Sri Lanka. For example, both have high debt levels. The fraction of public debt to the gross domestic product (GDP) is over 65 per cent for both countries.
However, while external debt alone is 70 per cent of GDP in Sri Lanka, in Kenya, this is at 35 per cent.
But, worryingly, this has also been growing fast in the last nine years. In 2013, Kenya's external debt as a percentage of GDP was at 26.3 per cent.
Economists noted that the best metric to look out for when analysing whether Kenya could also default on its loans, especially international loans should be foreign exchange (FX) reserves versus the forex obligations in the near term.
Sri Lanka, which defaulted on $51 billion (Sh550 billion) of international debt, didn't have ample reserves to meet the upcoming debt payment obligations, a situation that was compounded by the drop in tourist earnings due to the negative effects of the Covid-19 pandemic.
In 2024, Kenya has a huge Eurobond payment that requires the government to have enough firepower to settle the debt.
Sri Lanka's import cover dwindled drastically to only cover 1.7 months of imports.
The reserves were not only enough to afford the country to buy food, fuel and fertiliser.
And forced between using its meagre reserves to either pay the international debt or buy food for its citizens, Sri Lanka opted to default.
Kenya also had the advantage of having a diversified economy.
Although Kenya's tourism was hit just like Sri Lanka's, it did not go down on its knees as there were other sources of foreign exchange reserves such as tea, flowers and diaspora remittances.
But because tourism is the second foreign exchange earner, it was hit the hardest by Covid-19.
The decision by the Sri Lankan government to ban the import of chemical fertiliser and urge farmers to use natural fertiliser also affected the production of tea, a major foreign exchange earner for the country.
In July, the country's foreign exchange (forex) reserves declined sharply by $226 million (Sh26.8 billion) after the National Treasury paid China loans borrowed to construct the Standard Gauge Railway (SGR).
This saw the forex reserves decline to $7.73 billion (Sh918.8 billion) from $7.95 billion (Sh942.9 billion) in the previous week.
Official forex reserves have continued to drop, despite a steady inflow of Diaspora remittances from Kenyans living and working abroad.
On July 21, the National Treasury was to pay instalments for two loans for the Mombasa-Nairobi leg of the Standard Gauge Railway (SGR) and another for the Nairobi-Naivasha phase of the modern railway amounting close to Sh30 billion.
The repayment left a huge hole in the country's reserve of hard currencies, leaving it in a precarious position in meeting its external needs at a time when Kenya is grappling with a dollar shortage.
The reserves did not improve even after the Executive Board of the IMF approved the disbursement of some $235.6 million (Sh28 billion) to Kenya as part of a programme aimed at helping the country address its debt vulnerabilities.
The SGR is one of the many infrastructural projects that President Uhuru Kenyatta's administration has constructed using debt, which stood at Sh8.56 trillion at the end of May, Central Bank of Kenya (CBK) data shows.
Speaking during this year's Madaraka Day celebrations at Uhuru Gardens in Nairobi, President Kenyatta hit out at those against his borrowing frenzy in the last 10 years.
Instead, he defended his administration for achieving a lot "using other people's money."
"The only time that debt is a burden to a nation is if the nation is led by a cabal of looters. But in the hands of a visionary administration, debt is a catalyst for rapid development," he said.
All three loans for the SGR were procured from China Exim Bank and denominated in dollars. In total, Kenya borrowed close to $5.09 billion (Sh600 billion) for the construction of the two phases of the SGR.
The two loans for the Mombasa-Nairobi phase of the SGR, which stood at $1.6 billion (Sh188.6 billion) and $2 billion (Sh235.8 billion) respectively, were signed in May 2014 and had a grace period of seven and five years respectively.
The loan for the Nairobi-Naivasha section of the railway of $1.5 billion (Sh176.8 billion) had a grace period of five years, having been signed in December 2015.
All these are to be repaid semi-annually on January 21 and July 21, with the interest rate calculated above the six-month London Interbank Offered Rate (Libor) rate.
Libor is the benchmark interest rate at which major global banks lend to one another in the international inter-bank market for short-term loans.
The two loans for the Mombasa-Nairobi phase ($1.6 billion and $2 billion) are to be repaid in 13 and 10 years respectively, while that of the Nairobi-Naivasha phase of the SGR was to be repaid in 15 years.
Repayment of its principal was to start in January 2021, while that of the $1.6 billion was to start in July of the same year.