One framing is the Axial Age, of Confucius, Socrates, Abraham and Buddha, was about a cultural transition from sacrifice-focused religions to ethico-philosophical framings, and this could be linked to the impact of a suite of -shared-technologies.
I would put Socrates in a key position in regard to defining philosophy, because his story, and especially his 'martyrdom for wisdom', was the lense that previous roles were focused into one by, into what was distinctly 'philosopher'. That is, not sage or mystic, but someone actively going out and questioning people, helping them to think through answers, in Socratic dialogue. I'd argue there is a crucial difference between pre- & post-socratics, due to this. And that what happened in Greece was subtly but importantly different than in India or China, for complex reasons (the Needham question implies, mainly geography). Aristotle was tutor to Alexander the Great, who's pursuit of legitimacy put huge resources behind promoting Greek scholarship, and texts.
Cities are part of it. Writing developed independently in Mesopotemia, China, and the Mayan Empire - the places where animals were domesticated, and cities became possible. Books were part of it. We have surviving work from oral traditions, I'd rate Ecclesiastes as philosophical, and the Buddhist Tripitaka. But to survive, they had to continuously serve the interests of someone wealthy enough to pay for the time of people to memorise these. Whereas a book can had through the whole 'dark' ages, and return when politics has changed. This allows far more elaborate texts, and far more continuity between spatially & temporally separated thinkers. For instance, we often have the Buddha arguing against other schools & positions, that we don't have records of. The Tripitaka exists for guiding Buddhist practice, not to record debates.
Oh, only for so short a while you have loaned us to each other,
because we take form in your act of drawing us, and we take life in
your painting us, and we breathe in your singing us. But only for so
short a while have you loaned us to each other. Because even a drawing
cut in obsidian fades, and the green feathers, the crown feathers, of
the Quetzal bird lose their color, and even the sounds of the
waterfall die out in the dry season. So, we too, because only for a
short while have you loaned us to each other." - Aztec prayer 15thC, so from shortly before European contact as I understand it. Lots more here.
At contact, the metropolis Tenochtitlan at the centre of what is now called Mexico City, was the biggest city in the world. Because of two things, very productive agriculture (chinampas, even now one of the most productive systems, like early aquaponics), and much safer sanitation (this was from the 'red mud', comparable to the special biota of the Ganges which also facilitated unusual population density). But Tenochtitlan was only founded in the 1300s, and it can be argued Aztec infrastructure and governance were nowhere near as mature as the city's size implied.
Mayan culture had written language, and numerical tax records (relatively recently decoded). Most of what has survived is in the Songs of Dzitbalche, a record of ceremonial rituals. The Maya linked together crops that needed high & low altitudes for a complete diet, and used llamas to move things. They had sophisticated 'research stations', terraced depressions that helped mimic microclimates across their range for crop breeding. One thing we are really sure about, is they had a problem with political succession - such a crisis is why they were more-or-less paralysed when the Spanish arrived. Confucianism is an example of a philosophy really taking aim at reducing the damage of power transitions, through an ethic of filial piety.
Africa had, and has, a special problem. That we evolved there, and so did our diseases. The Tsetse-fly belt near the equator penned in hominids for around a million years. And the total burden of disease and stress factors saw our direct ancestors population stay stable at around 20,000, for at least 100,000 years - and leaving allowed rapid population growth. The climate oscillates with El Nino, driving continuous food insecurity. Abu Bakr II set off the cross the Atlantic in the 1300s, and the Malian empire was sophisticated as a result of trading nearly all the gold in the Old World across the Sahara, and we have oral history from their griot tradition. Swahili culture of East Africa was not militarily or politically united, but traded as far as China, and at least to the Indian Ocean in ancient times. We discussed the origin & drivers of distinctively African Ubuntu philosophy here. St Augustine of Hippo, probably one of the two most important Christian thinkers, was a dark-skinned North African. And the Western Caliphate made many contributions, from Morocco mainly.
Zoroastrianism and Parsis from Iran were the pioneers of (very close to) monotheism, with a long impact on Abrahamic culture, and in India where they were driven by Islam. Alexander the Great got as far as North India, showing how widely connected the region was. And Judah straight-up was in the Middle East, with the most influential theological innovations in the world (the impact of a day off a week for all at the same time, is underappreciated). Writing had to start somewhere, and it was Mesopotemia - Greece and Judah were majorly impacted by that.
You can place all the responsibility for the distinct tradition of philosophy on the Greeks. But that would be a mistake. Every book Aristotle intended for public circulation is lost, over 150; we only have his teaching & lecture notes. Early Christianity was very anti-pagan, enough to destroy many Greek texts. Luckily the Islamic Golden Era saw a flourishing of scholarship and translation in that lacuna, that brought many books back to us - later unravelled in the Islamic world, who got them back from the West even later. Ireland is underappreciated as a hub of European learning through the dark ages, reckoned to be the most literate European Christian country during most of this time.
So first, how much has been lost, like most of Aristotle? Second, mechanisms of continuity and preservation of texts, deepened dialogues, and required institutional or state support - so, institutions, or states (inc empires).