They were possible because old civilizations developed mathematics which is valid till date and not just number zero.
Then ancient civilizations had thier own philosophical works or political treatise or linguistic knowledge or medicinal science too.
Ever heard about charak shamita or shusruta...