Force responsible for this is electrostatic force of repulsion , it means that both balls have same type of charge.
Hope it helps you!!!
The balls have similar charges. They move away due to repulsion between similar charges. Both Balls might be positively charged or negatively charged, either way similar charge repulses each other and opposite charges attract.