The story
By metonymy, from 19th century discount sales of products that had been damaged by fire or that could no longer be stored because the storage facility had been destroyed by fire necessitating immediate sale or loss of value.
Etymology from Wiktionary, CC BY-SA 4.0.