When you are rubbing the glass rod with the silk cloth, electrons are stripped away from the atoms in the glass and transferred to the silk cloth. This leaves the glass rod with more positive than negative charge, so you get a net positive charge.
Why do the electrons go from glass to silk and not from silk to glass? That depends a lot on the minute details of the material. Ultimately, for every two materials there is one of them where electrons are happier. It just turns out that for glass and silk, electrons are happier at the silk cloth.