At it closest point Libya is just 200 miles from Europe, a relatively short boat ride across the Mediterranean.
In 2009, after 40 years of Colonel Moammar Gadhafi's rule, Libya's six million people enjoyed the highest per capita income of any African country.
The country produced about 1.5 million barrels of oil a day, and the Libyan coast guard helped interdict African migrants trying to get to Europe.
Libya's troubling past
Historically Libya was once divided into three regions: east, west, south, each with competing tribes, and differing shades of Islam. The vast majority of Libyans live along the coast.
When Gadhafi seized power in a coup in 1969, he was still a captain in the army. He kept his grip on power by adroitly mixing mafia-style punishment with tribal infighting, playing one group against another so he held sway.
His style of government meant that all power was concentrated in his hands, so once he was gone, there was no residual technocrat or bureaucrat class left to pick up the pieces.
All that remained were the rivalries he nurtured and tamed; unleashed they've been tearing up the state ever since.
Today Libya is in chaos.
Oil production is barely a quarter of what it was.
Since Gadhafi's overthrow and his summary execution at the side of a road in October 2011, the country has dissolved into city states, tribal and militia fiefdoms that ISIS is exploiting.
In 2014 Islamist Militias forced the internationally-recognized government to flee the capital Tripoli. They took refuge in the East of the country.
Until early 2016 an Islamist dominated government ran the capital. No one controlled the whole country, and instability was rife.
As ISIS did in Syria, so it is doing in Libya: strategically stretching its reach, taking advantage and exploiting Libya's chaos.
They have already been successful: In Libya's weakened state ISIS has already begun to metastasize, taking control of Sirte, Gadhafi's home town, and challenging for control of oil infrastructure.
Their forward retreat from Syria is being engineered to give them a new solid stable base of operations. They are still building that base, but so far with an estimated 6,000 fighters in country they are increasingly hard to destroy easily.
ISIS has already used Libya as a base from which to kill 32 British tourists on a sun-drenched beach in neighboring Tunisia. And that's only a sampling of what the terror group may be planning.
As migrants stream across the Mediterranean into Europe, remember ISIS has already been cynical enough to insert bombers and assassins among them in overcrowded boats leaving Turkey for Greece.
At least two of the Paris suicide bombers passed through Greece posing as migrants, according to Paris prosecutors, and according to German authorities, other ISIS members have done the same.
The U.N. has grafted a third government onto Libya's shattered body politic: the General National Assembly (GNA) headed by Fayez al-Sarraj, a Libyan of no particular political note prior to his elevation into the role.
Grudging buy-in for this still-shaky deal came from the Islamist militia-led government in Tripoli and the formerly internationally-recognized secular/technocrat government they ousted 2014.
The dead wood of the old governments has yet to be cut away, and Sarraj's GNA has yet to dominate the militias that must sustain and protect it.
The new seven-member ruling council is holed up in rusting naval sheds in Tripoli harbor, its security dependent on politically-discredited Islamist Militia like Hakim Belhaj.
What's at stake
Today Libyan federalists, particularly in Cyrenaica in the east, are clamoring for decentralized rule. The prospect of 1,200 miles of coast, up for grabs for any central government to own and secure makes that argument seem seductive.
A chaotic decentralized Libya leads to a free flow of migrants across the med to Europe. This strains and weakens Europe.
A functioning Libya patrols, controls and regulates its own borders, most importantly those in the south through which sub-Saharan migrants flow.
In the next few years the Syrian exodus will ease but Africa, burdened with many afflictions, not least climate change, food shortages and struggling economies, will continue to unload its unwanted northwards towards Libya and Europe.