In Gabriel Phthalimide Synthesis, why do we use $\ce{KOH}$ in first step rather than directly adding an alkyl halide?
2 Answers
It is used to make the conjugate base of the imide which is far more nucleophilic than the imide itself, but not too much to attack another molecule of the alkyl halide.
The goal is to make a primary alkylamine without causing polyalkylation. If you do not activate the pthalimide nitrogen with a base, you have a highly delocaled lone pair on the nitrogen. At best, you get an Sn1 reaction, however that will not give a primary amine as loss of the halide (if you can force it to go) will undergo Wagner-Meerwein rearrangement (hydride shift) to give a secondary or tertiary amine. This is the point of the Gabriel phthalimide synthesis.