How did Lennon and McCartney write songs together?
While they continued to write some songs separately, the need for instant hits in the early phase of Beatlemania meant that they worked even more closely together: We wrote' From Me To You ' together in a van. The first line was mine and then after that we took it from there.'
Similarly She Loves You was written by the two working together in their hotel room while on tour.
Method
Contrary to the Tin Pan Alley tradition, there was no job separation between librettist and lyricist. Both found the words part more challenging. As John would later put it, 'the music is sort of easy'.
As neither read music, they worked by ear or from scribbled chord charts. Lyrics were often a collection of scraps of paper.
Tunes had to be remembered without notation and then demonstrated. They would sing snatches and improvise chords, building harmony as they went along.
Credits
From the beginning they had an explicit agreement that all songwriting credits were shared, regardless of their individual contributions. According to McCartney: The only thing we knew about songwriting was that it was done by people like...Lerner and Loewe.
This would prove a shrewd decision. It meant that the 179 songs credits would include songs intended for other artists like The Rolling Stones, Cilla Black and later Mary Hopkin.
Royalties flowed into both bank accounts regardless of the actual authorship. For their first (disputed) British number one Paul got a song he didn't write ('Please, Please Me) Likewise John Lennon received handsome royalties for his non contribution to Yesterday.
More on the Lennon/McCartney songwriting partnership here.