When does attraction or repulsion occur when unlike material brought near to each other?

because the charges are opposite that causes the material to repel. because the charges are opposite that causes the material to repel.