It is the simplest way to answer the question "where does this pipe actually go?", and it is often the first step in resolving a dispute with a neighbour or a water company over a shared run.
Dye testing is also how misconnections are proven — a bathroom waste discharging into a surface water drain will show up immediately at the outfall.
It is normally done alongside a CCTV survey, which shows the pipe condition while the dye establishes the connectivity.