What does cv::detail::leaveBiggestComponent() do?

With reference to the Stitcher class provided by OpenCV, there is a function called cv::detail::leaveBiggestComponent(), and I would like to ask what does it do?

It comes after pairwise matching is executed, if I am not wrong.

Does anyone have a clue on this?

see opencv/stitching_detailed.cpp at 17234f82d025e3bbfbf611089637e5aa2038e7b8 · opencv/opencv · GitHub