The protons in the nucleus are all positively charged. Like charges repel, so all the protons in the nucleus must be constantly repelling each other. In order for the nucleus to be stable, with all the protons confined within it, there must be another force acting. This force – called the strong nuclear force - must be

In fact, the strong force can be repulsive for extremely short ranges, as shown above. There is an optimal distance, where the force between nucleons is most attractive, and the potential energy is minimum.