The testicles are designed to register pain to force us to protect them and prevent injury. And that is what an athletic cup does.
The testicles are exactly where you would get kicked in many sports, and their location on the body makes them quite challenging to protect even if we were standing still. But body movement in sports makes that far more difficult.
The ubiquitous jockstrap was invented in 1874 by Bike Athletic., and they are also often (incorrectly) credited with the invention of the athletic cup as well.