In the hydrolysis of Phthalimides we can see two successive hydrolysis of "amides" see ChemLibre for a nice mechanism
This is interesting because normally (also according to ChemLibre) amides are very stable (the amine is a poor leaving group) and don't react.
Nevertheless the first hydrolysis can be rationalized because the nitrogen electrons are delocalized and there is ring strain. Similar to how beta-lactams are more reactive than normal amides.
However, the second reaction appears to be just a normal amide hydrolysis. How does this happen?