Dielectric effects can cause metals to degrade, so different metals touching each other in the presence of moisture (cold would sweat, at least sometimes) can cause problems. A poorly completed joint where they did not ream the end of the pipe round again after cutting can cause turbulence over time and turbulence can erode the pipe (cavitation). Is there a joint within a foot or so of where the holes are?
Sometimes, a section of pipe is just bad. Had one in the last 60-years at my mother's house...cut out the section with pinholes about 40-years ago, and no new problems since...
Unless your in an area with aggressive water and copper has problems, the cost of a total repipe may be only good for peace of mind...things could last for decades without issues again. Then again, if this has happened before, it may just be the tip of the iceberg. Can't say without further info.
If you have the section that was replaced, you could cut it open and look at the insides. That might give you an idea of what you are dealing with.