A "critical threshold"' causes the fish to form shoals covering many kilometres
Researchers in the US have recorded the point at which hundreds of millions of herring coalesce into a vast shoal.
The team used equipment, which they also invented, that uses sound waves to remotely monitor movement of the fish.
They found that, when the herring numbers reach a tipping point, or "critical threshold", this triggers a chain reaction whereby the shoal forms within seconds.
The findings are reported in the journal Science.
Herring form shoals to migrate during the autumn spawning season.
The shoal moves in a "highly organised fashion" and hundreds of millions of herring travel together to shallower waters to spawn.
The very ordered movement of the fish has reinforced an earlier theory that very large groups of migrating animals - swarms or shoals - act as one.
Fibre optic ocean
The technology the researchers used is called Ocean Acoustic Waveguide Remote Sensing.
This produces an image of the whole shoal by bouncing sound waves off the bodies of the fish.
With this equipment, measurements could be taken at such a high speed that the team was able to create a moving image of the forming shoal.
Using sound waves to monitor animals in the darkness of the ocean is not new.
But traditionally, a single survey vessel sends high-frequency sound beams into the ocean - taking a snapshot of a relatively small area.
The new system uses much lower frequency sound that can travel much farther.
"It's like using the ocean as a fibre optic cable," explained Nicholas Makris, the Massachusetts Institute of Technology (MIT) professor who led the research.
"The low frequency beams stay trapped in the water column and can cover a 100km area in a minute and a half."
This, says Professor Makris, is a vast improvement over conventional techniques, which Makris compared to "watching one pixel on a movie screen" while the new technology allows you to "see the entire movie".
'Cities of fish'
The herring's initial movement seems to be triggered by the reduction in light as the sun sets.
"When the light fades, it's safer for the fish to move away from the seabed," says Professor Makris.
"Once they have a certain number of other fish in their sphere of perception, they suddenly come together - forming a shoal covering tens of kilometres within tens of minutes."
The herring gather in such huge numbers, and under cover of darkness, for "synchronised spawning". This helps protect them from predators.
The ordered movement of the shoal means the fish can reach their spawning ground more quickly and more safely.
"This is truly a commute," says Professor Makris. "And there are truly cities of fish down there."