Throughout the Muammar Gaddafi era, relations between Libya and Egypt were volatile. Gaddafi was an admirer and ally of Gamal Nasser, who ruled Egypt from 1958 to 1970, but far less fond of Nasser's successor, Anwar Sadat.
In 1977, Libyan and Egyptian forces came to blows, ostensibly after a dispute over control of Libyan oil fields. Impetuously, Gaddafi expelled more than 200,000 Egyptian migrant workers from Libyan territory.
Algeria mediated and brought the conflict to an end before too much damage was done, but diplomatic ties between the two countries remained frozen until 1989.
In 1997, Gaddafi and Hosni Mubarak, who replaced the assassinated Sadat as Egyptian president in 1981, agreed a deal to build a gas pipeline from Libya to Egypt.
This was the first in a series of trade agreements reached between Tripoli and Cairo which stretched on for more than a decade. Most involved ever greater amounts of Libyan energy flowing eastward to Egypt, whose economy during this period grew at an impressive rate but was structurally very weak.
Today, in the aftermath of the collapse of both the Gaddafi and Mubarak regimes, the new rulers of Libya and Egypt have decided to pursue the programme of economic integration initiated in the late 1990s. Last month, Libya's government authorised the transfer of $2 billion to the Egyptian treasury.
Quoted in the London Financial Times, a Libyan spokesman described the transfer as a "long-term investment" designed to "strengthen relations".
As far as is understood, no formal conditions were attached to the deposit and Egypt is not under any obligation to pay it back.
Speculation about Libya's capital 'gift' to its Egyptian neighbour is rife. One theory is that Libya, whose own (already rather ramshackle) economic infrastructure was devastated during the conflict which deposed Gaddafi, is keen to attract tens of thousands of Egyptian labourers to help aid its national reconstruction process.
Another is that Libyan authorities offered the payment in return for the extradition of a number of former Gaddafi officials and family members currently residing in Egyptian cities.
The recent arrest in Cairo of Gaddafi's cousin, Ahmad Gaddaf al-Dam, along with two other ex-Gaddafi associates, adds some credence to this account, although an Egyptian court has since ruled against extraditing al-Dam.
A less conspiratorial explanation might be that Libyan leaders recognise the logic of developing a more deeply-rooted economic relationship with North Africa's most populous country. Currently, Libya exports more to Italy, Germany, France, China, Spain and Tunisia than it does to Egypt and its 80 million-plus citizens. Moreover, as its own crude oil reserves have depleted (production peaked in 1993), Egypt has become increasingly reliant on foreign oil imports, making Libya, which has huge oil resources, an increasingly important trading partner – a status Libyans are no doubt determined to maintain well into the future.
What kind of gift?
Nonetheless, $2 billion is a significant sum, especially for a country facing substantial economic challenges of its own. Over the course of the 2011 civil war, Libyan output fell by 41% and, two years later, has not yet returned to pre-war levels, despite the tentative revival of its energy industry.
Libya is also blighted by widespread unemployment – particularly among the young – and high rates of poverty and social deprivation.
The failure of the Tripoli central authorities to bring the militia groups which emerged during the fight against Gaddafi under control has compounded the country's myriad security problems and undermined the reconstruction effort – estimated to cost £125 billion ($190 billion) over the coming years.
The decision looks stranger still in light of Libyan efforts to recover billions of dollars' worth of state assets the Gaddafi family illegally stashed away in foreign investment portfolios.
The Libyan government has even gone as far as to solicit the help of Interpol to help track down its missing assets, as well as those responsible for their theft.
The Libyan Investment Authority, which under Gaddafi was charged with managing the nation's oil wealth, lost yet more billions purchasing dubious financial products from Western banks and hedge funds, including French company Société Générale and New York-based JP Morgan.
Yet Libya's financial difficulties are dwarfed by those of Egypt, whose current, official unemployment rate is 13% (though this is highly optimistic given the chronic weakness of its vital tourism industry).
In addition, inflation is running at approximately 8% and the government's budget deficit has hit 12%, while the number of Egyptians living in poverty has risen from one-fifth to a quarter in less than four years.
Perhaps Libya's 'generosity' stems from a pragmatic assessment of the state of its larger neighbour's economy, with the implicit understanding that any further ruptures in Egyptian public life could have profound consequences for the prospects of regional stability.