The ship did not need a favorable wind to reach the quay. It needed a favorable angle. Against an oncoming breeze, a grand sailing ship could make progress by steering obliquely across the wind, then changing direction and repeating the maneuver until the port drew near.
The trick was less defiance than negotiation with physics. Air flowing around a sail produces an aerodynamic force with a component that can drive the vessel forward. The hull and keel resist much of the sideways motion, although some sideways drift, known as leeway, remains. The ship cannot point straight into the wind: there the sails lose their useful shape and driving force. Instead, it sails on one angled course, turns its bow through the wind, and takes up an angled course on the other side. That turn is a tack.
This zigzag was costly, especially for a heavily rigged ship. Each turn demanded coordinated work with sails and yards, while currents, shallow water and crowded approaches could limit the room available. Square rigged vessels generally could not sail as close to the wind as ships with suitable fore and aft sails, making their route longer. Near a confined harbor, a ship might wait for a change in conditions or rely on assistance rather than tack all the way to its berth. Beside the bustling quay, the carved hull rests still, its long detours hidden by the straight line of the shore.