Egypt is in a deadlock of political infighting ever since 2023 - between the old guard of its army and the new generation of officers. It's not a literal civil war but rather an elaborate and behind-the-scene series of cloak-and-daggers. But other than that, they fear retribution from the cliques; who threatened to poison the Niles if they dare. And since they're willing to release a small stint of neurotoxin upon the town square of El Gubba over a small contingent of protesters, the Egyptian government won't take any chances.
What happened to Algeria? (I think Algeria could intervene to prevent piracy and to stop rebels from crossing the border)
You're on point with what you've just said: Algeria has been successful in terms of dealing with local piracy, especially with their technologically dated but decently-sized navy. They're also successful in counter-insurgency over the Great Eastern Sand Sea. However, the Algerian coastlines have never been popular with the corsairs in the first place and despite their ability to secure the region, that's because most of them are rare and minor.
When it comes to military intervention, it's was a disaster, and that's before the rise of the Green Army. They send an expedition from the Great Eastern Sand Sea, with 50,000 men joining the fight. They tried to curb down the factional infighting of the city-states and helping the Mansur Clique as their benefactor, but ever since then, only a few thousand of them returned. So they switch strategies: from intervention to containment. They still support the Mansur Clique, however, albeit only in terms of supplies and arms.