Answer
They repel electrically because they have the same charge. However, they attract each other because of the short-range strong nuclear force. With the help of electrically neutral neutrons acting as a glue, the attractive forces win out.
Work Step by Step
This is discussed on pages 622-623.