Enemy forts augment the number of naval units you need to blockade an harbor (only if they have gun). High level entrenchments too (emplaced guns only).
If you control some forts, this reduce the number needed.
Once you blockade all exit points, the port is blockaded.
The actual numbers needed for each sea region is 4, +2 if there is an enemy fort/emplaced guns, -2 if there is a friendly fort/emplaced guns

Here I have a fleet with one frigate, so I need 6-1 = 5 more ships to blockade Mobile Bay. I had to run the 2 forts in order to approach the harbor by the way, as shown by the messages.