Step 1: the event rate in one arm. Take arm B, and write \(n = n_B\) and \(p = p_B\) for short. Since \(a \sim \text{Binomial}(n, p)\), the observed rate \(\hat p = a / n\) has variance
\[\text{Var}(\hat p) = \frac{p(1-p)}{n} \tag{1}\]
Step 2: from the rate to the log odds. The log OR is built not from \(\hat p\) but from its log odds, \(g(\hat p) = \ln\frac{\hat p}{1 - \hat p} = \ln\frac{a}{b}\). The delta method handles this change of scale. Near \(p\), the curve \(g\) is close to its tangent line:
\[g(\hat p) \approx g(p) + g'(p)\,(\hat p - p) \tag{2}\]
On the right of (2), \(g(p)\) and \(g'(p)\) are fixed numbers; only \(\hat p\) is random. Multiplying a random quantity by a constant multiplies its variance by the constant squared, and adding a constant leaves it unchanged, so
\[\text{Var}\big(g(\hat p)\big) \approx g'(p)^2 \, \text{Var}(\hat p) \tag{3}\]
Step 3: the slope of the log odds. Writing \(g(p) = \ln p - \ln(1 - p)\) and differentiating:
\[g'(p) = \frac{1}{p} + \frac{1}{1-p} = \frac{1}{p(1-p)} \tag{4}\]
Step 4: combine. Substituting (4) and (1) into (3):
\[\text{Var}\left(\ln\frac{a}{b}\right) \approx \frac{1}{p^2(1-p)^2} \cdot \frac{p(1-p)}{n} = \frac{1}{np(1-p)} \tag{5}\]
Step 5: back to the counts. Because \((1 - p) + p = 1\), the right-hand side of (5) splits into two fractions:
\[\frac{1}{np(1-p)} = \frac{(1 - p) + p}{np(1-p)} = \frac{1}{np} + \frac{1}{n(1-p)} \tag{6}\]
In (6), \(np\) and \(n(1-p)\) are the expected numbers of events and non-events. Replacing them with the observed counts \(a\) and \(b\) gives the variance for arm B:
\[\text{Var}\left(\ln\frac{a}{b}\right) \approx \frac{1}{a} + \frac{1}{b} \tag{7}\]
Steps 1 to 5 apply unchanged to arm A, with its counts \(c\) and \(d\):
\[\text{Var}\left(\ln\frac{c}{d}\right) \approx \frac{1}{c} + \frac{1}{d} \tag{8}\]
Step 6: two arms. The log OR is a difference of the two log odds, \(y_i = \ln\frac{a}{b} - \ln\frac{c}{d}\). For independent quantities, \(\text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y)\), and the two arms enrol different patients, so adding (7) and (8):
\[v_i = \text{Var}(y_i) \approx \frac{1}{a} + \frac{1}{b} + \frac{1}{c} + \frac{1}{d} \tag{9}\]
which is the formula above.
What it implies. The smallest cell dominates (9). A trial of 1,000 patients per arm with only 5 events on A still has \(v_i > 1/5\), so a large trial with a rare event can be less precise than a small trial with a common one. When a cell is zero, \(v_i\) is infinite, which is why a continuity correction, typically adding 0.5 to every cell, is applied. That correction is itself an assumption, and one that can move results when events are sparse.