Mesopotamia was a collection of peoples, its civilization had its beginnings in the Sumerians of the protohistoric Uruk era. However alot, and arguebly most of its fame comes when the Tigris and Euphrates floodplains were settled and its urban culture adopted by migrating waves of nomadic pastoral East Semitic tribes of the proto Akkadians and Eblaites, arriving eastwards from the Levantine and Sinai into the lower fertile crescent following the end tails of the Sumerian dominated Uruk period of Mesopotamia
Semitic infiltration and demographic takeover of Mesopotamia reached its peak under the migration of the NW Semitic Amurru, arriving from northern Syrian who further Semitized the many of the famous Mesopotamian civilizational centrepeices and hallmarks left behind by the Akkadian Neo-Assyrian Empire and lower Mesopotamia, and established their own in turn, such as Babylon
This is not similar to Egypt.
Egypt was created and powered by the Egyptians and no one else. Foriegners came from all diections over several thousands of years, and were always doomed to be swallowed by Egyptian demographic and SE dominance. Mesopotamia was trampled under the many various and mostly Semitic conquering ethnic groups who arrived from all direction, who imposed themselves and made the Mesopotamian majority encultrate to their languages, identities, and cultures
Egypt was a single state for most of its history, inhabited by a single ethnic group. Mesopotamia is only a civilizational network settled by many different ethnicities and ruled by a multitude of states
The two couldn't be more different for this comparison, because they are not equivalents
Per capita, Egypt was far superior. Their time span, deep civilizational memory and legacy outshines that of Mesopotamia. The ruins of the many fabled cities of the Akkadian, Amorite, Babylonian, and Sumerian haven't been found, while the Great Pyramid was the tallest and biggest structure for most of recorded human history