This is a difficult question to phrase so bare with me. From reading questions on this site, I understand that a written contract (e.g. a lease) is only a written record of the actual contract, that is to say the understood "abstract" contract takes precedence. So someone can't argue something silly like "the contract said I must pay them $100 but never specified the currency". But in complex situations, different parties may have different interpretations of the contract, even after signing it in writing. Just because something is in writing doesn't mean it's clear.
My question is, isn't it wrong to think that in court the judge and jury are trying to establish the actual understood contract? It is very well possible that the parties were not on the same page when the contract was formed. If this were the case, then what is the job of the judge/jury?
For example if Bob and Joe are going to court because Bob believes Joe owes him $100 in accordance with a contract they both signed, but Joe believes he doesn't, if the contract really is ambiguous and both Joe and Bob really do believe they are in the right, what is the job of the Judge and Jury? You can't really say it's to find out who was right because there was a misunderstanding when the contract was formed - but I don't think that invalidates the contract because businesses do this all the time to rip people off for money :P
Is it possible the a judge/jury actually decides who wins the case based on the judge's/jury's own interpretation of the contract and not the plantiff's or defendant's?
UPDATE: sorry for the confusing question, I think what I was trying to get at is what happens when a party finds an "alternative" interpretation to a clause before agreeing to it, so they can find a loophole if/when a dispute arises. I think large corporations do this a lot.