Well, I will try to give you an intuitive understanding.
Consider there are two forces acting on the nucleons, the strong force (attractive, short ranged and acting between all the nucleons) and the electromagnetic force (repulsive, long ranged and acting only between protons). Now if you want to keep your nucleus stable, i.e. attractive forces should be more than the repulsive forces.
Now consider as your size of nucleus increases or the atomic no. increases, no of proton goes on increasing. But then, since EM force is long ranged, it eventually overtakes strong forces. So, to compensate for this one needs to have excess of neutron.
Or one can see it as this, when no. of proton increases one proton should not be surrounded by too many proton, rather there should be a plenty of neutron to compensate for the EM repulsion.
So yes, to compensate this repulsion between protons, proton gets converted into neutron and a positron. which is a very good way to stabilize, since you are getting double benefit by doing this, one proton no. is getting reduced, while your neutron no is jacked up. Both contributing to higher stability.