Say I make a big win at a casino and walk out with a suitcase full of cash*. I decide I want to buy a car with it, so I head down to a car dealership, and buy a car - which I pay for by handing over said suitcase.
The next day the police turn up at my house. Apparently, the car I'm driving was reported stolen by the dealership. I insist that I paid for it; they say I didn't. Which way does the court rule?
In theory, I should be presumed innocent until proven guilty, so they would have to prove that I didn't pay. But it's impossible to prove a negative, so they can't. On the other hand, I can't prove that I did pay - there is no way I can prove that the suitcase full of cash was handed to the dealer, rather than say buried in my back yard, as that is also proving a negative (that I don't still have the money).
So what happens?
This question is not actually about car purchases; that is an illustrative example, so please ignore the unrealistic bits. This question is about how courts handle cases where it is impossible to determine the truth, and both parties have a stake.