$$P(A \mid B) = \frac{P(A \cap B)}{P(B)}, \qquad P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)} \ (\text{Bayes})$$
The probability of $A$ given that $B$ happened is the chance both happen divided by the chance of $B$; Bayes' rule flips the conditioning when you know the reverse direction.