Why do we scratch the walls of test tube in test for magnesium or calcium basic radicals? In test for calcium ion, we add ammonium carbonate in presence of ammonium hydroxide and then white precipitate (of $\ce{CaCO3}$) is formed which is dissolved in acetic acid and then reacted with ammonium oxalate to form $\ce{CaC2O4}$. But it says you have to scratch the walls of the test tube to get the precipitate. Why is it so?

Similarly, for magnesium ion we add ammonium hydrogen phosphate to get white precipitate. For this reaction too, the walls of the test tube are to be scratched to get the precipitate.

I read somewhere that scratching creates a surface for recrystallization of the precipitate. I just don't really understand what does it mean. Can someone explain it?
Scratching causes microscopic shards of glass to chip off the scratched surface which can break the surface tension of the liquid, allowing the solute to precipitate/crystallize from of the supersaturated solution.