HI Sam,
If you get a quiet moment, read carefully what Chris and MB wrote, that's a lot of info but well communicated.
I hope this pic might help describe some of the effect of the headsail has on bending the wind favourably for the main.
This "slice" of air flowing over the
leeward side of the mainsail starts off 60cm to
windward of the centre line of the boat.
The higher the airflow speed over the sail the more lift it generates. The airflow over the main is accelerated by the effect of the headsail.
This shows the effect the headsail has on the mainsail, the result is a gain in more lift.
Credits for the analysis and imagery go to W&B sails.