It just seems like an incredibly strategic location, particularly for early settlers who relied on rivers for trade and transportation.
A nearby example would be St. Louis, a fairly large city built where the Missouri enters into the Mississippi River.
While more can always be said, this question gets asked on this sub somewhat regularly. This thread includes answers by /u/amp1212 and /u/MrDowntown. MrDowntown also answered this question before here. If you want further information, there are several more threads on the subject in this sub as well.
TL;DR: Because it floods.
I’m more of an armchair historian, so I understand if my comment is deleted, but I can provide detail on the decline of Cairo at least.
Cairo had a bit of rough start. Founded by John Comegys on 1,800 acres of land in 1817/18, there were plans for a levee and a grand railroad connected to Chicago, but he died before plans were underway. By the 1830s, infrastructure in Cairo grew exponentially but the railroad was delayed until 1856 largely due to finance. The city flourished afterwards due to connection to land and river trade.
It continued to flourish in the Civil War as a site of military encampments and hospitals. The city suffered from yellow fever in 1878 but didn’t break and was a comparatively decent sized city of 9,000 or so at the time.
The population continued to grow but river trade declined and more and more was shipped by rail. This led to a decrease in ferry traffic, but a bridge constructed at Thebes in 1905 led to a decline in rail traffic as well. The death knell for ferries came in the 1930s with more bridges for motor and rail traffic. Only barges passed by the city then, and they had little need to stop at Cairo.
At a peak of about 15,000 in 1920, the city’s population steadily declined due to the economic downturn. White supremacist attitudes and policies made things worse, with a lynching of a black man in 1909 and again in 1967. Riots broke out in 1967 and was followed for years afterwards by unrest, due to a largely segregationist white population. A ten year boycott on white owned businesses was organized, causing many merchants to leave town. The final blow to Cairo’s economy came from the construction of I-57, bypassing the town. It now has barely 2,000 people.
TLDR: Cairo was at one point a relatively major hub but declined to its current state largely due to circumstance, the transfer of trade from ferries to trains, and white supremacy.
Sources: Roadside History of Illinois, Stan Banash
US Census
“Cairo, Illinois - Death by Racism”, Legends of America
“Race ‘War’ in Cairo, Reconciliation Grows as Memories Recede”; Washington Post.