Note: The majority of this text is extracted from my answer to a related question.
We consider general problem of subtracting two real numbers, i.e.
$d = a - b$. This problem is ill conditioned, when
$a \approx b$. In particular, if
$\hat{a}$ and
$\hat{b}$ are approximations of
$a$ and
$b$ respectively, i.e.,
$$ \hat{a} = a(1+\Theta_a), \quad \hat{b} = b(1 + \Theta_b)$$
and
$\hat{d} = \hat{a} - \hat{b}$, then
$$ \frac{d - \hat{d}}{d} = \frac{b\Theta_b - a \Theta_a}{a-b}.$$
It follows that the relative error is bounded by
$$ \left| \frac{d - \hat{d}}{d} \right| \leq \frac{|a|+|b|}{|a-b|}\max\{|\Theta_a|, |\Theta_b| \}.$$
If
$a \approx b$, then the right hand side can be large and there is no guarantee that
$d$ is computed with a small relative error. Frequently, but not universally,
$d$ will be computed with a large relative error. This is the phenomenon known as subtractive cancellation or catastrophic cancellation.
If the machine uses floating point arithmetic, then the very best we can hope for is to obtain the floating point representation of $a$ and $b$, i.e., $$\hat{a} = \text{fl}(a), \quad \hat{b} = \text{fl}(b).$$ In this case
$$\max\{|\Theta_a|, |\Theta_b| \} \leq u,$$
where $u$ is the unit roundoff. In IEEE single precision arithmetic $u = 2^{-24}$. In IEEE double precision arithmetic $u=2^{-53}$.
On the other hand, if $|a| \ge 2|b|$ or if $|b| \ge 2|a|$, then
$$ \frac{|a|+|b|}{|a-b|} \leq \frac{3}{2}.$$
This is an application of the triangle inequality. It follows that any subtraction $d = a - b$ causes at most a modest increase in the relative error if one operand is at least twice as big as the other.
EDIT: In response to a comment: If $a$ and $b$ are IEEE floating point numbers with $b/2 \leq a \leq 2b$ and if underflow is gradual, then the subtraction $d=a-b$ is exact, i.e, there is no rounding error. This is Sterbenz lemma.