Questions about distal segments in HTM theory

Thanks for the clarifications! I read the BAMI pseudocode, but as I am interested in biological plausibility I always try to see how this is happening in the brain. The winning cells are those that contain the segments that best correspond to the previous activity in a mini column, if not have that segment, a new segment is formed in the cell with fewer segments, right? But it is still not clear to me why winning cells are differentiated from active cells to determine the potential connections of the distal segment. Is this an optimization or does it happen in some way in the brain?