That castles are best situated near communications routes (water or land) is mentioned, but not quite why. The purpose of castles was primarily interdiction of supplies. Armies could bypass them, true - but then sorties from the castle later would cut their supply line. In a time when disease and pestilence were the greatest enemies of every army, and good roads and convenient navigable rivers rare (before canal locks got to the West), castles were very effective cripplers of enemy armies.