the law of total probability
Often you cannot compute the probability of an event A directly, but you can if you first ask 'which scenario are we in?'. Suppose every outcome falls into exactly one of several scenarios B1, B2, ... Bk — for example, the email is spam or not spam; the patient is sick or healthy; the urn you drew from was urn 1, 2, or 3. The law of total probability lets you compute P(A) by averaging A's chance across all the scenarios, weighted by how likely each scenario is.
The formula is P(A) = P(A given B1) P(B1) + P(A given B2) P(B2) + ... + P(A given Bk) P(Bk), provided the scenarios B1...Bk form a partition (they are mutually exclusive and together cover everything). In words: split the world into cases, find A's conditional probability in each case, then take the weighted average using the case probabilities as weights. The simplest version uses just B and its complement: P(A) = P(A given B) P(B) + P(A given not B) P(not B).
This 'divide into cases and recombine' move is everywhere. It is the denominator in Bayes' theorem (the overall chance of the evidence), the way to find the expected outcome of a two-stage experiment, and the engine behind first-step analysis in random walks and Markov chains. The honesty caveat is that the cases must genuinely partition the space: if they overlap, you double-count; if they miss something, you undercount.
A factory's bulbs come 60% from machine 1 (2% defective) and 40% from machine 2 (5% defective). The overall defect rate is P(defective) = (0.02)(0.60) + (0.05)(0.40) = 0.012 + 0.020 = 0.032, that is 3.2%.
Average the conditional defect rates, weighted by each machine's share of output.
The B's must be a genuine partition: mutually exclusive AND exhaustive. Overlapping cases double-count; gaps lose probability. Each P(Bi) should be positive for the conditional terms to make sense.