The expression is proposed by the ancient military thinker Sunzi in The Art of War, and is one of his principles of conducting warfare. Sunzi believed that a commander should, on the basis of an accurate assessment of one's own and the enemy's force deployment, attack the weak front in the enemy's deployment with superior force. This would ensure victory. This tactic is later also used by people to deal with social activities in which there is competition.
Commanding troops should be like the flow of water. Water runs from a high point to a low one. Troops should avoid attacking where the enemy defense is strong but instead attack where its defense is weak. Just as the flow of water is determined by terrain, war fighting should be based on the assessment of the enemy's situation to secure victory. (The Art of War)