In every DLT, a transaction have a probability to be valid. (in bitcoinIn Bitcoin, a transaction is valid as long as it is written in the longest chain, so the probability for your transaction to be invalid is the probability that a longer chain exists somewhere without your transaction).
In a blockchain like bitcoin Bitcoin: 2 conflicting transactions cannot be in the longest blockchain.
In the tangle it is fundamentally different : 2 conflicting transactions can be in the tangle. It is not a problem because only one of them will eventually be seen as valid eventually.
The probability for a transaction to be valid is equals to the proportion of tips validating the transaction (directly or indirectly). The following picture illustrate thisI created some illustrations to explain how a double spend is detected. Let's start with a tangle without a conflict:
Now if you introduce conflicting transactions (X and Y) in this tangle we will have this :
When we add more transaction, the conflict will be detected and kind of split in the tangle will occurs:
And the split will be resolved by eventually making the red part orphan.
In this example, the tangle choose Y as valid, fundamentally this decision was random, but once this decision is taken it become practically impossible to revert it.
Regarding the time to detect, you can figure out that it depends of on:
- the number of new transactions
- the average "width" of the tangle