The answer is a combination of military and political reasons.
Israel had survived several wars up to this point, from enemies who outnumbered and wanted to completely destroy them. Their success had created a strong belief in Israeli might, both internally and externally. This war changed their outlook.
Israel had caused severe damage to its enemies and had occupied the Sinai Peninsula. A continuation of the war would have cost Egypt dearly to recapture it. However the war was not totally successful for Israel. They had an army in Egypt that was surrounded and would have taken heavy casualties to be extracted (Politically catastrophic as Israel has always been sensitive to casualties due to their low population). The Israeli cost of the war was high due to being caught unaware. Therefore, both parties wanted a way out of the war with the least amount of damage.
From a real politik perspective, if Egypt has failed to destroy Israel and conceivably would continue to fail, it would be more beneficial to acknowledge the current state of affairs and act accordingly rather than beat its head against a wall over and over. Israel would have been more eager to seek a peace, as the war had shaken their psyche, and having lost their "invincible" status they anticipated further attacks from previously beaten enemies.
In exchange for returning Sinai, Egypt acknowledged Israel's existence. I believe there was a political reason, in terms of Egypt was wary of another Arab power (probably Saudi Arabia).
Economically, Egypt made the transition from the Soviet bloc to the Anglo bloc. This realignment with the Americans brought large amounts of Economic and Military aid, as well as diplomatic and trade concessions with the members of the American Sphere. The thawing of relations was very beneficial to both parties. Economically for Egypt, and militarily for Israel.