Lets consider how the air meets the mainsail, the only sail hoisted. The wind, in a free space, is initially in parallel lines, however as it gets close to the sails, it divides, some lines to one side, and some to the other.
With the sails being curved, the air to the leeward side follows the curve around the sail. The air to windward, though, can proceed in its straight line. Since the curved (leeward) air stream is longer than the windward side, then to reach the leech at the same time (which it should, otherwise we will have turbulence and drag) the leeward air has to travel faster than the windward air.
This accelerated flow of air, as it moves faster, creates an area of lower pressure – lower than the other (windward) side of the sail. This difference in pressure pushes the sail away from the high pressure side, towards the low pressure side. If there were no keel, the boat would slip sideways – a dinghy with its centreboard up!
The keel provides a similar set of curved flow lines, in the opposite direction to the sails. The lift in this case is pushing the keel to windward (and further heeling the boat), which keeps the boat from going sideways.