Chain fishing is when you reel in Pokemon using a rod continuously every time. This increases the chances of encountering a shiny Pokemon after about 40 chains to 1/200. The way to chain fish is to have a Pokemon with the ability Suction Cups at the front of your party when fishing, as this allows you to reel a Pokemon every time. You can also fish beside a rock, it has the same effects as Suction Cups. It doesn't matter if you defeat the wild Pokemon or run away, but moving from the spot or using your roller skates will break the chain.
Here is a video on chain fishing, it could help you understand better.
Hope I helped!
Source: Experience