When you rip the two pieces of tape off the table, there is a tug-of-war for electric charges between tape and table. The tape either steals negative charges (electrons) from the table or leaves some of its own negative charges behind, depending on what the table is made of (a positive charge doesn’t move in this situation). In any case, both pieces of tape end up with the same kind of charge, either positive or negative. Since like charges repel, the pieces of tape repel each other.
When the tape sandwich is pulled apart, one piece rips negative charges from the other. One piece of tape therefore has extra negative charges. The other piece, which has lost some negative charge, now has an overall positive charge. Because opposite charges attract, the two pieces of tape attract each other.
When you run a plastic comb through your hair, the comb becomes negatively charged. Tapes repelled by the comb have a net negative charge, and tapes attracted by the comb either have a net positive charge or are uncharged.
You may have found that your hand attracts both positively and negatively charged tape. Your body is usually uncharged, unless you have acquired a charge—by walking across a carpet, for example.
An uncharged object attracts charged objects. When you hold your hand near a positively charged piece of tape, the tape attracts electrons in your body. The part of your body nearest the tape becomes negatively charged, while a positive charge remains behind on the rest of your body. The positive tape is attracted to the nearby negative charges more strongly than it is repelled by the more distant positive charges, and the tape moves toward your hand.
Note that charge leaks slowly off the tape into the air or along the surface of the tape, so you may have to recharge your tape after a few minutes of use.