This passage comes from Sophocles' Antigone and is found in a lengthy speech that Haemon makes to his father Creon, who is the king of Thebes.
Haemon is trying to persuade his father to be more flexible in his decision making. Creon has declared that Antigone, who is Creon's niece and Haemon's fiance, must be put to death.
In making his argument, Haemon draws upon illustrations from nature and from sailing. Thus, using figurative language about trees and sailors, Haemon tries to get his father to appreciate the strategy of "bend but don't break." In a storm, trees that don't bend and sailors who don't slacken their sails end up getting destroyed. On the other hand, trees that bend and sailors who slacked their sails remain intact.
So, Haemon is trying to get his father to be more flexible with respect to Antigone. Unfortunately for Creon, he does not decide to become flexible until it is too late. By the time Creon reverses his death sentence against Antigone, she has already killed herself.