There is a range of possible feelings as you run a marathon. I've run eight... four are worth noting in response to your question.
The first, in my early 20s, pretty capable, stupid-cocky, but not fit, ran a total of 120 miles over the five weeks leading up to the race. It was a"relay" with best 3 of 4 times added to determine the finish. I was in deep trouble at 22 miles... a couple 11min miles followed. My buddy's GF hollered that a teammate had dropped out, I closed the last 2.2 in 12:xx to catch our #2. Did my "job" I guess, puked, felt terrible, during and after for a couple weeks), learned a lesson.
Six months later, well-trained, confident with a sub2:40 goal. Temps reached the mid80s and I was seeing stars and lightning bolts, head aching like someone was pounding nails into my head... I was sitting on a curb at 19 miles. Learned another lesson.
Fast forward 25 years... fourth marathon in my second running "career". Solid training for an old guy with a job and family. No real goal, just wanted to compete well... maybe break 3:00. 6:50s through 21 miles, then it became a grind. Not especially painful, just got progressively harder to drive forward. Son ran the last miles with me... laughing at me "grunting" as I tried to maintain pace. Took all my effort to run 7:30s to the finish... not really hurting, just couldn't go. I guess this is what it felt like to run out of ready fuel. Another lesson learned.
Six months later, with a better fueling plan for the week before and during the next race... I felt solid to the finish with no discomfort unusual or unexpected for a long distance race. Only pain was mental in the days after the race. To explain; I was comfortably running 6:30s for most of the race, enjoying the time, occasionally greeting/talking to others... average pace was 6:39 through 21 and knew I was going to break 3:00 as long as I didn't screw up. So I switched mindset to "get to the next mile mark in 7". Which I did even as a younger guy passed me at ~23. Got to 25 feeling great and crushed the final 1.2... ran through the line smooth and fast, well under 3:00, continued to the bleachers at the end of the stadium, sobbing (don't know why, emotional release, I guess...). As time went on, I regretted not making an effort to compete to the finish. Another lesson learned.