All matter is made up out of atoms. Now, atoms themselves have a core or nucleus, and electrons orbiting around the nucleus. The core has positive charge, the electrons have negative charge.
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 a net positive charge on the glass and negative charge on silk.
Why do the electrons go from glass to silk and not from silk to glass? That depends a lot on the properties of the material to hold electrons. 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.