The initial Northern Songs Company was set up by Beatles' manager Brian Epstein and publisher Dick James, with Lennon and McCartney as minor shareholders. Lennon and McCartney eventually sold their Northern Songs shares, and the copyright went with the sale. With hindsight, The Beatles have learned the massive value of publishing rights, and would have acted differently had they been aware at that time.
But as young musicians, they were unaware of the importance of their decision, and in those more naive times, so probably was Epstein.The complexities concerning The Beatles' legal dealings are far too complex to go into here, but the simplified version is that Northern Songs was eventually aquired by ATV Music, who then sold it on to Michael Jackson. The story goes that Jackson told Paul McCartney that he, Jackson, would aquire the copyright to The Beatles' material as soon as he could - McCartney didn't take Jackson seriously, and was most upset to find his material bought by someone he regarded as a friend. There is nothing underhand or illegal in Jackson's acquisition; it was a simple business transaction which anyone with the finnancial backing could have achieved. Relations between McCartney and Jackson remain 'strained', especially since Jackson arranged for Yoko Ono to receive a higher royalty rate for use of the Lennon-McCartney compositions.