I was an opiate addict for 10 years, and still use a bit. Never bought off the street; always got pharma connects, except for opium which I got some a local guy with some flowers. During the whole time I've been a software engineer, and done some cool stuff. I'm also bipolar, and opiates have been my treatment. Opiates don't make you dumb like pot. I'm totally functional, indeed, more functional (as evaluated by third parties inc medical professionals) when using opiates.
Opiates are amazing. They take away a lot of depression. I got up to 50mg of oxy a day, which is quite modest and very inexpensive. It made me happy. Melted away worries. At one of my startups, we got crossed by a partner, almost had to fire everyone. The stress was paralysing - business partner attempted suicide. Me? Start the day with oxy and feel ready to take on things.
Even now, it can change that morning lethargic everything-sucks-why-don't-I-binge-Star-Trek-or-kill-myself into "hey I'm gonna write some software".
The other comments describe it alright - a warm happy dream. It's quite pleasurable even if you're by yourself; you can spend hours just "nodding" off, in and out of consciousness. It's quite sublime. The peace is so powerful, that a few times when I was being self destructive and got to the edge of OD, I noticed but simply didn't care. I'm more careful nowadays, though oral opiates are quite safe if you don't act reckless.
IV opiates step it up a bit. Users talk of a rush. It's similar to an oncoming amazing orgasm x10, then the warmness floods your body and everything's perfect and you might even gasp for breath it's that good. I think part of that is just the IV, and having a huge shift so quickly. For instance, there's a rush when IV'ing midazolam (dangerous, do not use without medical supervision), right before you pass out.
I've gone off opiates a few times. It wasn't as an enjoyable life. The only downsides are constipation (eh, saves time) and possibly lower testosterone (as someone often manic, lower libido is great - but it's easy to get TRT anyways.) I've not seen much as far as long-term damage from use.
Or maybe you're right: they just take away pain. But it turns out a lot of us have existential pain so it works all the time.