It's random, but it spreads with a simple logic - a greater depth will flow "out" to a lower adjacent tile, and a 1/7 will not flow further. If the flow is in a closed space, it's going to overflow the moment it has somewhere to flow to.
In the case of "falls", you are putting a 7/7 depth below the "drain" tile - what it does then follows the above rules. If you have that centered on a 3x3 drain system (with grates or floor bars, typically), then that one central tile can't spread further than you have covered with your drain system. (Unless that system fills to 7/7, even momentarily - but...)
However...
If you pump the fluid, it pumps (much!) faster than a single tile can drain. If your 3x3 catch-system is counting on 1 or even 2 tiles of "down" to carry the liquid off, it might not keep up with the in-flow. (It can if you pump it "out" tho'.)
The trick I've found with pumps is to divert the majority of the flow off somewhere else, perhaps to recycle, perhaps down a chasm, whatever, and let about 1/3-1/5 of the pumped output route itself to the falls. I do this by offering the main "flow" other options, so only a bit ends up going down that drain system - the rest is never gets a chance to overflow the falls drain system.