Shoaling/schooling is a defensive ploy. Fish school up if they feel threatened. In a small quiet tank, or an overcrowded tank, the need to school is gone, so is not often seen. The environment is what causes shoaling.
Take 20 Neons and put them in a typical small community tank and they'll all go their own way. Put exactly the same fish in a 200 gallon tank with limited hiding opportunities, they'll stick to each other like glue.
You should not aim for frightened fish. Stressed fish rarely show their best colour and often don't live as long.