Rubbish had accumulated on the riverbank.
People in the old days didn't mind the trash on the roadside.
Kana spelling is more common in modern usage when the word appears.
The historical derivation is uncertain; the kanji 芥 is conventionally associated with 'rubbish' or 'dust'.