Automatic distribution of voices

I have a question. I just opened an arrangement from 2017. It looks surprisingly good, but I’m wondering how Cubase 15 decides which voice appears in which staff.
For example, the B in the middle of the chord—right at the beginning of the bar—is in the right-hand staff; however, on beat 3, it is in the left-hand staff. Both notes are on MIDI Channel 1, Voice 1.
On beat 5, it appears in the left-hand staff again, but within the track, it is assigned to Channel 4, Voice 1.
Nor could an automatic split have occurred at a specific point, because on beat 7, there is even a G in the right-hand staff (Channel 4, Voice 1).

I am currently in the process of separating and reorganizing the tracks, but I would really like to understand how this works.