The question of why the Saudis agreed to reconciliation with Iran has several answers.
One of the most important of them is the understanding of the Saudis that this is the only way they will be able to bring an end to the threat/fighting in Yemen with the Iranian proxy, the Houthis.
The war in Yemen cost the Saudi coffers many billions of dollars, not to mention the thousands of casualties. Even worse, the Saudis understand very well that the growing threat from Yemen endangers the "Vision 2030" plan to diversify the kingdom's sources of income due to the threat of Iranian-made missiles and UAVs to the cities of Saudi Arabia and its economic facilities.
Despite the agreement, the enmity between the parties has not disappeared and will emerge in the future, although the Iranians have an interest to preserve the agreement.
The fact that China was able to mediate shows an increase in interest in the region - not particularly happy news for the Biden administration.