At a point in the fill cycle, the velocity of the water causes the pipes to resonate, shaking them enough to make a noise. It is similar to whistling. Cars do this, too. There is a speed that will cause the steering wheel to vibrate. If you go faster or slower, things smooth out.
Resonance is often beneficial.
As the float gradually rises, the valve closes, changing the speed of the water. Generally, the metal variety of ball cocks has a washer and seat, like all faucets used to have. If the washer becomes loose, it will vibrate, causing the water to turn on and off very quickly, which shakes the pipes. This would be the problem if the noise occurs during most of the fill cycle. In either case, if this type of valve uses replaceable washers, try a new washer.