I know nothing about boats. I have often noted, however, the dilemma of Lewis Carroll's Captain Bellman in The Hunting of the Snark.. For him:
. . . the principal failing occurred in the sailing,
And the Bellman, perplexed and distressed,
Said he had hoped, at least, when the wind blew due East,
That the ship would not travel due West!
But, strangely enough, while a sailing boat cannot do precisely what I suppose Lewis Carroll meant - sail straight into the wind - its capability for maximum speed occurs when doing nearly that, when heading close to the direction from which the wind is blowing. Even more paradoxically, a boat can achieve speeds much greater than the wind speed; indeed the present record for sailing boats, about 46 knots, was achieved when the wind was only 20 m.p.h.
Yachtsmen, it seems, concern themselves, not just with one wind, but with three: the real wind, the apparent wind, and what appears to be a wind that dare not speak it name - that caused by the movement of the boat itself.
The real wind is that experienced by you and me. Any movement of a boat, however, creates another "artificial" wind whose speed is equal to that of the boat itself, and whose direction is precisely the opposite of the boat's heading. The apparent wind, which provides the vessel's motive force, is the net result of the combination of these two.
A boat running downwind cannot go any faster than the real wind speed; when it reaches that speed - and leaving aside other complicating factors - the "wind" resulting from the movement of the boat is equal and opposite to the real wind; the apparent wind is therefore zero. There is no motive force, and no further acceleration of the boat takes place.
For obvious reasons, a boat cannot make headway directly into the wind: the wind will tend to blow it backwards. But at a relatively small angle to the real wind, on either side, the angle of the sail can be arranged so that the relatively small component of the real wind tending to edge the boat forward is augmented by the wind resulting from the movement of the boat itself. In these circumstances the faster the boat goes the greater the apparent wind, and the greater the force available to provide acceleration.
Under these circumstances the boat will continue to accelerate until water resistance on the hull prevents it from going any faster. Top speed is therefore determined, not by the wind, but by the characteristics of the hull.
But then, as I said, I know nothing about boats.