Single cars are often set out because of a defect such as bad brakes, broken coupler, or damaged wheel. In such cases, the car is put on a siding, warehouse spur, or yard track to prevent a problem from developing, then later fixed and moved. With bulk commodities such as potash there is little pressure to be quick about it but a car carrying hot merchandise (electronic goods for example) would most likely be fixed right away or its cargo would be transloaded into another freight car for shipment.
A string of freight cars parked on a siding in the middle of nowhere is usually being stored where the cars won't hog valuable track space. The cars could be obsolete, waiting for their end at a scrapyard, or they could be excess resources during times when there are more cars in the system than are needed to satisfy shipping demands.
I'm fascinated by the way a railroad will leave a single car out in the middle of nowhere. It's like those old abandoned houses out in the desert. There's a story to be told, but no one to tell it.