Attraction of the opposites. The positive ions inside the classroom are attracted to the negative ions outside of the classroom.
Detailed explaination: There’s more to it to this comic actually.
Lithium, sodium, potassium, rubithium and caesium (inside the classroom) are metals that belong to group I of the periodic table. Fluorine, chlorine and bromine (outside the classroom) belong to group VII of the periodic table.
Going down group I, the metals increases in atomic number(number of protons which are positively charged), hence the number of electrons(negatively charged) increases as well. These electrons are situated in electron shells. Therefore, the more electrons you have, the more shells you have. With more electron shells, there is greater screening effect. This means that the pull of the protons on the outermost electron shell is weaker in Cs as compared to Li because Cs have greater screening effect.
Therefore, when these metals form ions, the positive charge on Na ion is stronger than Cs ion. (Although they are technically +1 in charge) That is why Na+ is stuck to the glass panel and Cs is further away.
I thought it was ingenious of the artist to include this extra chemistry detail into his drawing.