Upwelling in the ocean is associated with the divergence of currents that bring deeper, colder, nutrient rich waters to the surface. The main drivers that work together to cause upwelling are wind, current flow, Coriolis effect, and Ekman transport. These drivers operate differently for different types of upwelling, but the general effects are the same. There are at least five types of upwelling: coastal upwelling, large-scale wind-driven upwelling in the ocean interior, upwelling associated with eddies, topographically induced upwelling, and broad-diffusive upwelling in the ocean interior.
With wind driven coastal upwelling, winds push the water in the surface layer of the ocean away from the coast and the water is replaced (upwelled) by cooler subsurface water. Relatively strong upwelling brings the cooler water to the surface. If fish and other organisms do not like the cooler water, then they will move away to warmer more comfortable waters. The distance that they move is a function of the spatial extent of the cooler water. It is not uncommon for fish to move 10-15 miles offshore over a relatively short time period (hours – days) depending on how fast the cooler water reaches the surface and spreads offshore.
Regarding the more technical Coriolis and Ekman effects, as a result of the wind forcing, the water is transported a net of 90 degrees from the direction of the wind due to Coriolis forces and Ekman transport. Ekman transport causes the surface layer of water to move at about a 45 degree angle from the direction of the wind, and the friction between that layer and the layer beneath it causes the successive layers to move in the same direction. This results in a spiral of water movement down the water column. Then, it is the Coriolis forces that dictate which way the water will move; in the northern hemisphere, the water is transported to the right of the direction of the wind. In the southern hemisphere water is transported to the left of the direction of the wind. If the net movement of water is divergent, then upwelling of the deeper cooler water occurs to replace the water that was lost.
If the cooler upwelled water is nutrient rich then the unused nutrients are usually taken up by the algae (e.g. phytoplankton). This uptake in combination with sunlight results in an algae bloom. While some fish (e.g. menhaden, herring, sardines) thrive in the algae bloom, others like tuna, marlin, mahi, and some sharks that are more visual feeders move away from these lower clarity. Often these fish are found along the boundary of the algae bloom water mass particularly if the water mass boundary is persistent spatially for a few days.
Finally, in some areas like off the Pacific Ocean coast of Costa Rica, the upwelled waters are low in oxygen which forces the fish either closer to the surface, or away from the areas with depleted oxygen.
Graphic shown below is a modified version that was found on Wikipedia.