Now she had liers-in-wait abiding in the inner chamber. She said to him, The Philistines are on you, Samson. He broke the cords, as a string of tow is broken when it touches the fire. So his strength was not known.
The reason Samson lost his strength was only secondarily that he allowed Delilah to cut his hair. The real reason was that "the Lord had departed from him" (Judges 16:20). When God’s Spirit departed from someone under the Old Covenant, the results were disastrous (cf. 1 Samuel 16:14; Psalms 51:11).