The origin of this proverb is from the Warring States Period (战国时期 zhànɡuóshíqī). The state of Wèi attacked Zhao and laid siege (围攻 wéiɡōnɡ) to its capital Handan (邯郸 Hándān). Zhào turned to Qí for help, but the Qí general Sun Bin determined it would be unwise to meet the army of Wèi head on, so he instead attacked their capital atDaliang (大梁 Dàliánɡ). The army of Wèi retreated (撤回 chèhuí) in haste, and the tired troops were ambushed (伏击 fújī) and defeated at the Battle of Guiling (桂陵之战 Guìlínɡzhīzhàn), with the Wèi general Pang Juan (庞涓 Pánɡ Juān) slain on the field. Note that this campaign is also described explicitly in the Art of War of Master Sun Bin the younger.
The idea here is to avoid a head on battle with a strong enemy, and instead strike at his weakness elsewher. This will force the strong enemy to retreat in order to support his weakness. Battling against the now tired and low-morale (士气低落 shìqì dīluò) enemy will give a much higher chance of success.