I am studying compound and conditional probability.I am facing some confusion regarding the following formulas . The first formula is about compound probability.
If $E_1,E_2,\ldots,E_n $are mutually exclusive and exhaustive events and $ E $ be any event
$$P(E)=\sum P(E_i)\cdot P(E \mid E_i)$$ If $P(E_i)>0$ and summation is from $i=1$ to $i=n$.
And the second formula is about conditional probability. I know that probability of occurrence of a event $A$ given that $B$ has already occurred is represented by $P(A\mid B)$.but I can't understand why the above expression should be equal to
$$P(A\mid B)=\frac{P(A \cap B )}{P(B)}$$ Please provide me some insight as to why the above formulas holds good.there must be some justification behind the formula. thanks.