I had always believed this expression is used to describe the need to proceed carefully in a delicate situation. The Internet doesn’t seem to agree with that. It does have a long history as a song. Wikipedia says it “topped the charts” for ten weeks after Nick Lucas introduced it in the musical “talkie” film Gold Diggers of Broadway in 1929. The tune was used in the first Looney Tunes cartoon short Sinkin’ in the Bathtub in 1930. Numerous other singers have recorded the song, including Tiny Tim in 1968. Some think it has a satanic origin, especially if played backwards. It was played several times in the horror movie Insidious.