For me it's mostly about psychological positives, and at times, mental distraction from the discomfort.
I love a prolonged climb - like up a mountain pass. It's a challenge and it is hard, and most people woundn't even consider doing it. That appeals to me.
If on a climb I really start laboring I focus on breathing and good exhalation, pedal stroke, and keeping the cadence up. And my thought process is to "just keep going baby!" I'll think stuff like "The descent from this climb is going to be awesome" or "I'm already half way there" that sort of thing. Or if it's into a headwind I think "this wind will be sweet on the way back."
Then at times when I'm not feeling so great and really want to stop, what works for me is to distract myself from the discomfort by letting my mind wander from the ride to something totally unrelated. When my mind returns to the ride I realize that I'm still motoring along and my condition is not so bad afterall - gives me a positive boost.