This hit song was written by Irwin Levine and Larry Brown and is based on the true story of a convict returning from jail. They got the story from a 1971 article in The New York Post, and changed some of the details. It was really a white handkerchief around the tree, but they made it a yellow ribbon because it made for a better song.
Source: Songfacts