Top runners can run fast and far without it hurting. But when going for personal bests / very fast times, my understanding is that it is painful, for most of the run. E.g. watch some parkrun vlogs, and you'll hear people say things like "after the first 1km it's really painful, so just take things one step at a time, and hold on to the pace", etc.
Yeah, max effort racing once you're well trained is basically doing math based on your training data to estimate your physical limit, and then spending the majority of the race in agony, telling yourself whatever is necessary to avoid slowing down to hit that limit.
If part of you isn't wishing for death by the halfway mark of a 5k race, you've probaly left time on the table.