understanding Boolean algebra ( Boolean algebra simplification )

F = A'BC + AB'C + ABC' + ABC


I know that by K-map answer is AB+AC+BC, and by boolean rules, it will be

=A'BC + AB'C + ABC' + ABC+ ABC + ABC
=(A'BC + ABC) + (AB'C + ABC) + (ABC' + ABC)
=(A' + A) BC + (B' + B) CA + (C' + C) AB
=AB+AC+BC


I can't get it, how we knew that we should add ABC to it??

If you look at the K-Map, you'll find that as you create groupings, you use the $ABC$ cell three times.

Using algebra we can do the same combinations, but that does mean we need $3$ $ABC$ terms.

And by the way, there is a handy boolean algebra rule that reflects the combining of adjacent cells:

$PQ + PQ' = P$

$A'BC + AB'C + ABC' + ABC = \text{ (Idempotence x 2)}$
$A'BC + ABC + AB'C + ABC + ABC' + ABC = \text{ (Adjacency x 3)}$
$BC + AC + AB$
You can observe that you can pair $BC$ in the first item with $BC$ in the fourth one: $$F=(A'+A)BC+AB'C+ABC'=BC+AB'C+ABC'$$ However, you could also pair $AC$ in the second item with $AC$ in the fourth one: $$F=A'BC+(B'+B)AC+ABC'=AC+A'BC+ABC'$$ Similarly, pairing $AB$ in the third item with $AB$ in the fourth one: $$F=A'BC+AB'C+(C'+C)AB=A'BC+AB'C+AB$$ Note that none of these final expressions is symmetric in $A$, $B$ and $C$, whereas the original one is.
This gives the idea of doing the three pairings all together, which is obtained by adding $ABC$ twice, justified because $P+P=P$: \begin{align} F &=A'BC+AB'C+ABC'+ABC \\ &=A'BC+ABC+AB'C+ABC+ABC'+ABC\\ &=(A'+A)BC+(B'+B)AC+(C'+C)AB\\ &=BC+AC+AB \end{align}