When you talk about the motion of anything, you need to first define what "not moving" means. For example I may be sitting in a chair (and not moving relative to the chair), but I know that the Earth is rotating, and orbiting the sun, and the whole solar system is orbiting in the Milky Way.
When I look at the motion of stars, I know that (nearly?) all the nearby stars are also orbiting the Milky Way. But I want to ignore that overall motion, and only consider the motion of the stars relative to each other.
It is possible to measure the motion of a star relative to the observer. We also know the motion of the observer relative to the sun (since we know how fast the Earth spins and how fast it orbits the sun) So by simply subtracting one motion from the other we can find the motion of the star relative to the sun.
But instead of using the sun as a fixed frame of reference, I can look at the local stars, find their average motion relative to the sun, and subtract that motion from each individual velocity. This will give a motion relative to the motion of the stars around the Milky Way. I know the average will be zero because I have chosen to subtract a certain amount from each star's velocity to make the average zero. It is zero "by construction"
(simple example Consider the numbers "3,7,2,3,5". The average is 4. If I subtract 4 from each number I get (-1, 3, -2 -1, 1) with average = 0)
The motion of a star, when you have subtracted the average motion of all the local stars, is called the peculiar motion