In the docs: https://docs.kicad.org/master/en/eeschema/eeschema.html#flat-hierarchy there’s a figure pic_sockets.sch which implies that Global labels DATA-RB7 and VPP-MCLR connect to correspondingly-named Local labels. (And CLOCK-RB6 seems to do nothing, and CLOCK-RBI i s suspect)
The rest of the docs don’t seem to mention that feature, and it would seem antithetical to the idea of keeping Local labels “local” to the one sheet. I also can’t get it to work when I test it. So I’d appreciate if someone could confirm that this is indeed an error in the docs, and that actually Local labels and Global labels do not connect to each other just by having the same name on a schematic.
[Later edit] I was wrong, all three types of label having the same name do connect to each other if they appear on the same sheet. Reading the discussion in this thread may still be useful.