This is because the comb gets charged when it is rubbed. All the objects that we see around us are made of atoms, which are small uncharged particles. It consists of a positive centre made of positively charged protons and neutral neutrons, and negatively charged electrons orbiting around it almost like planets orbit around the sun.
These atoms contain equal number of protons and electrons so they are uncharged.
So the surface of any object made of atoms has electrons, which are negatively charged.
When the comb is rubbed against the cloth the electrons move between the two, and the comb gets charged.
Many of us have learned in school that like charges repel each other and unlike charges attract each other. The same thing happens when the comb is brought near neutral paper strips. Within the papers strips, the electrons get either repelled or attracted according to whether the comb has a negative or a positive charge. This makes the paper strips have an unlike charge in the direction of the comb, and makes them rise towards it.
This charge that is created when two objects are rubbed against each other is called static electricity. It is different from the electricity in our homes in that it does not move, as compared to the electricity in our homes which moves through wires and other conductors.