From what I understand, it is needed if a perfect seal when connecting the colon sections is not attained. The surgeon pumps air or water (I forget exactly what gets pumped) in to test the seal. If bubbles are emitted, then the seal isn't perfect and the surgeon has the opportunity to try again. The maximum times he or she can do this is twice, so if the seal isn't perfectly tight the second time, a temporary ileostomy bag is needed until nature takes its course and the tissue heals up and seals. That's my basic understanding.
P.S. I have expressed extremely strong wishes not to have an ileostomy bag. Therefore, my surgeon is using staples instead of sutures because staples provide for a better seal.
Wife 4/17 Dx age 45
5/17 - Lap left hemi
5 x 4 x 1 cm
T3 N2b M1a
Stage IV A
lymph nodes: 9 of 54
8/17 Sub-total colectomy
2nd tumor 5.5 cm width T1 N0
CEA: 1.4 Pre-op; 2.1 2 days Post-op
Lynch no; KRAS wild
Immunohistochemsistry: Normal expression of MLH1, MSH2, MSH6, and PMS2
Tumor DNA variants: MTOR, APC, TP53