The worse shape you're in, the worse you feel after a race. As others have said, elites spend an incredible amount of time training -- way longer / harder than the actual race. Mo Farah has said he never felt pain in a race until the last lap or two. Unless, it's a record attempt where these guys are going hard from the gun, just a lap or two of pain isn' t hard to recover from.
The interesting thing is elite female runners collapsing at the finish far, far more than male runners, who almost never collapse. It's obviously not a fitness thing, but I read somewhere it's a biological thing where their legs just give out under extreme stress. Odd, only for females.