The choice-of-law question depends on the nature of the dispute, the contract terms, and the laws governing the choice of law.
If the dispute relates to a contract
Many contracts specify the governing law. The courts will often honor the choice-of-law provisions, with some exceptions. If the contractual relationship has no connection to the state, the choice-of-law rules of a particular state may override the contractual choice of law.
If the contract does not have a choice-of-law provision, the court will apply the choice-of-law rules of the state where it sits. The choice-of-law rules can be found in the case law or in statutes. Those choice-of-law rules typically consider which state has more connection to the contract, where the contract should be performed, the place of contracting, the location of the subject, where the parties are incorporated or headquartered, and other factors.
If the dispute relates to non-contractual claims
Even if the claims are non-contractual (such as fraud, conversion, negligence, or unfair competition), some contracts may still specify the governing law for those situations. But this will depend on the interpretation of the choice-of-law provision and the specific facts of the case.
If the contractual choice-of-law is found inapplicable, the court will apply the choice-of-law rules of the state where it sits, which may depend on various factors. For example, the court may look at the connection of the dispute to the state, where the events took place, where the losses or injury were sustained, and where the parties are located.