When we rubbed the glass rod on a piece of silk cloth, the positive charges were transferred from silk to the glass rod. Now the rod is charged positively.
When the rod is brought near the pieces of straw, the electric field of the rod influences the straw and it gets polarized ie the negative charges move near the rod and the positive charges on the other side of the rod. And hence they attract each other.
Static charges are produced by the friction between two interacting bodies
The charges exert a force on each other - Unlike charges attract each other