A dollar to be received with certainty (for example, you have purchased a bill from the US government) at time $t$ will be valued at $e^{-rt}$.
If you are uncertain about whether you will receive the dollar or not, you should take this into account. A simple model is that the institution who is supposed to pay you will default with probability $p$, in which case the value of the dollar is
$$
V = p \times 0 + (1 - p) \times e^{-rt} = (1-p)e^{-rt}
$$
For convenience, we often write this as the discounted value of a dollar with a risky discount rate $\lambda$, that is,
$$
e^{-\lambda t} = (1-p)e^{-rt}
$$
which rearranges to
$$
\lambda = r + \frac{1}{t}\log\left( \frac{1}{1-p} \right)
$$
when $p$ is small, this is approximately $\lambda \approx r + p/t$. The following two situations are equivalent -
- Discounting an uncertain payment with a risk-free discount rate
- Discounting an assumed certain payment with a risky discount rate