Fifth Syrian War
The Fifth Syrian War occurred between 202 BCE and 195 BCE upon the death of Ptolemy IV Philopater and began over who would be the regent to a young Ptolemy V Epiphanes. The war would begin with the murder the sister and wife of Ptolemy IV named Arisnoe by the ministers Agothocles and Sosibius. It is unknown what happened to Sosibius but Agothocles would act as regent until he would be killed by an angry mob. The Sixth Syrian War would also be caused by rogue ministers acting as regents for a young king.
From here the regency would pass between various people and the Ptolemaic Kingdom was more or less in a state of political and social chaos. The leader of the Seleucid Empire named Antiochus III the Great took advantage of the power vacuum in the kingdom and began an invasion of Coele-Syria. Antiochus III would initially ally himself with Philip V of Macedon but this quickly fell apart.
See Battle of Panium
The lack of a real leader in the Ptolemaic Kingdom meant that Coele-Syria was claimed very quickly by the Seleucids. A brief setback at the settlement of Gaza would eventually lead to a decisive victory of the Ptolemic military at the Battle of Panium near the head of the River Jordan which allowed the Seleucids to capture the strategic port of Sidon. After the Seleucid victory over the Ptolemies the Roman Republic would send emissaries in 200 BCE to demand that Philip and Antiochus cease their military campaign to invade Egypt.
At this time Egypt supplied the Romans with essential grain that they needed to sustain their massive growing population in Rome and elsewhere on Italy. However, neither the Macedonians or the Seleucids wanted to invade Egypt so they acquised to the Roman ultimatum and set out to finish conquering Coele-Syria. The Seleucids would eventually complete this by 198 BCE and eventually move onto raid the last remaining Ptolemaic coastal settlements in Caria and Cilicia.
During this time the Ptolemaic Kingdom could hardly do anything about the loss of its territory as there was significant social economic and political strife going on within Egypt itself. During this time the Ptolemaic Dynasty of Egypt was weak and ineffective due to years of complacency and indulgence. The Egyptian nativist movement that began before the Fifth Syrian War began with the Egyptian Revolt had expanded to include the Egyptian priests. This cause significant problems with sedition within Egypt at the time.
The economic problems led the Ptolemies to simply increase taxation which just helped fuel the Egyptian rebellion going on at time. In light of the domestic problems the Ptolemaic Kingdom signed a peace treaty with Antiochus in 195 BCE. This granted the Seleucid Empire with control over all Coele-Syria and also came with the condition that he marry he daughter named Cleopatra I.