In the 1960s (and today) songwriters receive a small amount of money for every record sale, something called 'mechanical royalties', to compensate them for the use of their songs. In the 1963-1965 period, according to Billboard, the standard rate in the US was 2 cents per track used, though there was discussion of increasing this to a (whopping) 3 cents per track in the linked article. In the UK, until the end of the 1960s, the standard rate was 1.5 pence per side (e.g., for every song you had on a disc). Generally, the expectation is that the mechanical royalty amounts to something like 5-10% of the sale price, depending on the time period and location.
Of course, mechanical royalties are paid not straight to the songwriters themselves, but instead are paid to publishing companies. The Beatles themselves had a publishing company, Northern Songs, which (according to Mark Lewisohn's Tune In) they started with the publisher Dick James, who had a 50% stake in the company, while Lennon had a 20% stake, McCartney had a 20% stake and their manager Brian Epstein had a 10% stake. So Northern Songs would receive this 2 cents per track, as administered in a territory by a publishing rights organisation (e.g., BMI or ASCAP in the USA, or APRA-AMCOS in Australia), and would distribute it between the company and the songwriter in a particular way; in the end the rights to the Northern Songs catalogue was famously sold to Michael Jackson, at one stage in the 1980s. Nonetheless, McCartney and Lennon (or his heirs) would continue to receive songwriter royalties that had been negotiated with Northern Songs' owners.
Three of the covers on With The Beatles, for example, were covers of songs from Motown Records: 'You Really Got A Hold On Me' (originally by Smokey Robinson & The Miracles), 'Please Mr. Postman' (originally by The Marvelettes) and 'Money (That’s What I Want)’ (originally by Barrett Strong, and coincidentally written by Motown founder Berry Gordy). Berry Gordy, before he started Motown, had written songs for the likes of Jackie Wilson in the late 1950s - he wrote 'Lonely Teardrops' - and so he had a pretty good idea of how music publishing worked, and so he kept Motown's music publishing in-house (Motown's Fordist production-line philosophy necessitated this - everything was in-house at Motown), starting a music publishing company called Jobete.
According to the book Motown: The Sound Of Young America by Adam White and Barney Ales (2016), Beatles manager Brian Epstein and Berry Gordy:
traded with each other at least once, when Epstein's firm asked Gordy to reduce the US publishing royalty rate on the three Jobete songs recorded by the Beatles. Ales and Loucye Wakefield approved of the discount, and eventually Gordy agreed. Even with the rate reduction, the result was at worth at least $15,000 to the Jobete coffers in the first year.
Remember that to make $15,000 on the publishing of three songs, at ~6 cents an album sold (2 cents for each song), you have to sell 250,000 copies of the album - a sizeable amount in those days. Presumably if the Beatles got the Jobete songs for half-price, for example, that was 500,000 copies. for Jobete, this was a sizeable income stream, and presumably if they'd said no to the Beatles, they might have recorded different songs - basically, the Beatles had come to them and said, "hey, want $15,000 for nothing? I mean, you're probably entitled to $30,000 for nothing, but if you want that we'll just cover something else."
Broadly speaking, Motown seemed very pleased to have the support of The Beatles, even at a discount - and the Beatles did support them and played a major role in promoting Motown in the UK. The White & Ales book the quote above is from is very much an official Motown coffee table book production kinda thing - I mean, co-author Barney Ales had been Executive Vice President and President of the company at different points (so when the quoted text above mentions 'Ales'...it's kind of weird that one of the authors of the book is mentioned in the third person). But I digress; when I looked at the index to the White & Ales book to try and find the anecdote about the With The Beatles publishing, there were 9 separate references to Epstein, showing the extent to which Motown are at least now happy to be associated with the Beatles.
Anyway, Berry Gordy would have said yes to the discount on the royalty rate partly because he wanted to cultivate that relationship and exploit it, and partly because $15,000 for nothing. In the first year alone. The Supremes in 1964 recorded the album A Bit Of Liverpool, on which Lennon and McCartney would likely have made 10 cents for each copy of the album sold (as they covered 'You Can't Do That', 'I Want To Hold Your Hand', 'World Without Love' which was written by Lennon/McCartney but recorded by Peter & Gordon, 'Can't Buy Me Love', and 'Hard Days Night' - sneakily enough, the Supremes also covered 'You Really Got A Hold On Me' and 'Do You Love Me', Motown tracks which had been covered by the Beatles and the Tremeloes, respectively - so those 4 cents stayed in-house). The White and Ales book interprets that album as being a bit of a thank you or a quid pro quo to the Beatles. And hey, it was 1964, the year when a novelty song like 'We Love You Beatles' by The Carefrees actually hit the top 40 of the US singles charts. And, well, A Bit Of Liverpool didn't do too badly for an album by a famously singles-oriented operation, which didn't have any hit Supremes singles on it, hitting #21 in the charts according to Wikipedia, at least.