As far back as the 1500s, bad or stale food that was not thought to be suitable for human consumption was thrown to the dogs. The expression caught on and expanded to include any person or thing that came to a bad end, was ruined, or looked terrible.