"First come, first served" is the rule of Black Friday, lining people up every year after (or on) Thanksgiving without fail. While you do need money to buy your desired products, in theory as long as you are the first in line, you have the priority to pick anything on the floor. Now, at the cashier, if you were required to prove that you did not intend to beat others in the race to the store in order to enjoy the benefit of being the first, what would you do? In a way, that is what an accused infringer may need to prove when filing a declaratory judgment (DJ) action in a patent case.
Generally, a patent owner is free to sue an infringer in any forum that satisfies the applicable jurisdictional and venue requirements, and will typically sue in the most favorable available venue. Rather than wait to be sued, an accused infringer may file a DJ action to "clear the cloud" of looming infringement allegations. If both parties file suits, the courts undertake an analysis under the "first-to-file rule" to determine which case should go forward, with a preference given to the first case filed. The courts dismiss, stay, or transfer the other suit to avoid redundant and possibly inconsistent litigation.