"Woodstock," made famous by CSN, was written by Joni Mitchell. She didn't actually perform at Woodstock because of a prior booking, but she was friends with C, S, & N, whose stories about the festival inspired her to write the song.
"Me and My Uncle," the song that the Grateful Dead performed live more than any other song, was written by John Phillips of the Mamas and the Papas. A few musicians were partying heavily in a hotel room, and Phillips strapped on a guitar and wrote the song on the fly. Someone had the presence of mind to turn on a tape recorder while he played it. Sometime later, Judy Collins, who had been at the party, listened to the tape, liked the song, and recorded it, citing Phillips as the writer. A few months later, he received a royalty check for a song he didn't remember writing. He called his manager, who told him that Collins recorded it. He called her and said he didn't write the song, so she played him the tape of himself performing it. He later joked that his memory of having written the song became clearer with every royalty check.