Those who remained in Egypt struggled to gain control of what was happening in Rome. Human nature being what it is conflict was inevitable. Ptolemy IX Lathyros’ initiative in moving to Rome as Sulla was partly to extend the process of controlling what was happening in Rome but partly to ensure that actions taken in Rome actions supported of his own objectives.
He was promoting not only his own position but also the position of his son who became Ptolemy XII.
The civil wars in Rome were simply a by-product of the civil wars in Eqypt.
We may assume that Julius Caesar and Pompey were in an an opposing faction. Certainly Pompey supported Ptolemy XI who was the nephew of Ptolemy IX Lathyros and the son of a brother (Ptolemy X) with whom Lathyros was in continual conflict.
Eventually Caesar defected to the Sulla faction (only after Sulla’s death). In the complexity of Eqyptian politics,this meant he was aligned with Cleopatra VII (the Cleopatra) before he ever met her.
Incidentally few writers have queried why Pompey ran to Egypt after his defeat by Caesar at Pharselus. It is of course because he believed his faction was in control in Egypt and he would be allowed to retire into Egyptian society.
Caesar pursued him to prevent him reactivating his faction in Egypt.
The stories of who killed Pompey are highly conjectural.