A lot of articles refer to apparent wind, but it may be simpler to understand if the apparent wind is split up into components perpendicular and parallel to the sailboat's heading with respect to the true wind. Say the boat is heading 30 degrees offset from directly upwind or downwind, the apparent crosswind is sin(30) x true wind speed = 0.5 x true wind speed, regardless of the sail boats speed. So if the wind was 10 knots, with that 30 degree offset, the apparent crosswind would be 5 knots, again regardless of the boats speed. The boats maximum speed would be how fast it can go with a crosswind speed of 5 knots, with losses due to drag (apparent headwind and drag from true water speed).
The major "secret" is not hard to understand. The shape of the hull is such that the boat moves forward with very little resistance, but it has great resistance to moving sideways (90 degrees from the direction the bow points). Therefore if you push the boat in a direction that has components in the forward direction and the sideways direction, the boat moves mostly forward and only a little bit sideways.
A fin keel pointing downwards adds to the sideways resistance.
Skilled sailors can adjust the sails so that the boat goes in the desired direction without any need for a rudder to steer. Each sail has different combinations of forward and sideways forces, and each sail is attached to the boat in a different place.