Granular things in bags are very hard to secure to a rack. The contents move away from ties as they are shaken by bumps. Either the straps get loose enough to fall away, or the bag oozes out from under them.
I lost a 30 pound bag of dog food right by the dog park on my way home. It ripped open and kibble poured out. Most of it was recovered, and the rest was cleaned up quickly by the locals.
I found the best way to carry a large bag like that on a rack is to fold the bag in a way that makes it's contents very tightly packed, then wrap a cargo net over it as tightly as possible. Smaller bags will fit into a pannier.
Dog food is just a pain to carry on a rack.