"Free as a Bird" is a song originally composed and recorded in 1977 as a home demo by John Lennon. In 1995, a studio version of the recording, incorporating contributions from Paul McCartney, George Harrison and Ringo Starr, was released as a single by the Beatles. It was released 25 years after the break-up of the band and 15 years after the death of Lennon. The single was released as part of the promotion for The Beatles Anthology video documentary and the band's Anthology 1 compilation album.
Origins
McCartney, Harrison and Starr originally intended to record some incidental background music, as a trio, for the Anthology project, but later realised, according to Starr, that they wanted to record "new music". According to Harrison, they had always agreed that if one of them was not in the band, the others would never replace them and, "... go out as the Beatles", and that the "only other person that could be in it was John."  McCartney then asked Ono if she had any unreleased recordings by Lennon, so she sent him cassette tapes of four songs. "Free as a Bird" was recorded by Lennon in 1977, in his and Ono's Dakota building apartment in New York City, but was not complete. Lennon introduced the song on the cassette by imitating a New York accent and saying, "Free--as a boid" (bird). The other songs were "Grow Old With Me", "Real Love", and "Now and Then". Ono says that it was Harrison and former Beatles road manager Neil Aspinall who initially asked her about the concept of adding vocals and instrumentation to Lennon's demo tapes. Ono stated: "People have said it was all agreed when Paul came over to New York to induct John into the Rock and Roll Hall of Fame, but it was all settled before then. I just used that occasion to hand over the tapes personally to Paul."  McCartney went to Ono's home after the induction ceremony at the Rock and Roll Hall of Fame to listen to, and receive, the Lennon demo tapes; he recalls the meeting with Ono:  She was there with Sean ... and she played us a couple of tracks. There were two newies on mono cassettes which he did at home ... [s]o I checked it out with Sean, because I didn't want him to have a problem with it. He said, "Well, it'll be weird hearing a dead guy on lead vocal. But give it a try." I said to them both, "If it doesn't work out, you can veto it." When I told George and Ringo I'd agreed to that they were going, "What? What if we love it?" It didn't come to that, luckily. I said to Yoko, "Don't impose too many conditions on us, it's really difficult to do this, spiritually. We don't know, we may hate each other after two hours in the studio and just walk out. So don't put any conditions, it's tough enough."  During an interview for the Anthology project, McCartney revealed that he was surprised to learn that Lennon's demos of "Grow Old With Me" and "Real Love" had already been released and were well known by Lennon fans. Starr admitted that when he first listened to the recording he found it very emotional.

Q: what were the orgins of this song
A: McCartney, Harrison and Starr originally intended to record some incidental background music, as a trio, for the Anthology project, but later realised,
What did they realized?
according to Starr, that they wanted to record "new music".
according to Starr, that they wanted to record "new music".