That usually means that the fish that is getting eaten has a wound, goldfish just like how wounds taste, can't help it.
And a wound, is cause by bullying, trauma or bad water quality, most likely all three in this case.
Each goldfish needs 10 gallons of water (40 liters) anything smaller, and they will be gradually poisoning themselves. This leads to bad water quality, which leads to stress, which leads to wounds.
Most important questions here are how big the tank is, how many fish you have and how long you've had it set up. It would help greatly if you'd share this info