Schooling of fish has very little to do with their education. It does have much to do with their ability to survive and reproduce in sufficient numbers. Schools are composed of many fish of the same species moving in more or less harmonious patterns throughout the oceans. A very prevalent behavior, schooling is exhibited by almost 80 percent of the more than 20,000 known fish species during some phase of their life cycle. There are many ecological advantages. Some species of fish secrete a "slime" that helps to reduce the friction of water over their bodies. Also the fish swim in fairly precise, staggered patterns when traveling in schools, and the "to-and-fro" motion of their tails produces tiny currents called "vortices" (swirling motions similar to little whirlpools).
Each individual, in theory, can use the tiny whirlpool of its neighbor to assist in reducing the water's friction on its own body. Another advantage is the safety factor against predators. A potential predator hunting for a meal might become confused by the closely spaced school, which can give the impression of one vast and frightening fish. Additionally, there is the concept of "safety in numbers"—a predator cannot consume and unlimited quantity of prey. The sheer number of fish in a school allows species to hide behind each other, thus confusing a predator by the alteration of shapes and colors presented as the school swims along.
In many ways fish schools are much like herds of land animals or flocks of birds. There is that undefined need to stay together.