Things you have some control over:
Birth plan. My second labour where I laid out what was right for me or not after a traumatic first birth was better for being assertive over some preferences. The ending went out of my ideal range, but getting 90% of the way there within my comfort zone meant that despite the delivery, the labour was a positive experience.
Hypnobirthing. It kept me calm in both labours. 2nd time, I played the track on repeat on speakers. My MW said it kept her calm, she loved it!
Keeping active. Part of my baggage from my first birth was from ending up beached on my back being monitored. It felt so wrong, and my body was too exhausted from a long labour and generally being incapacitated with SPD to cope with getting comfortable. Second time, I knew more and part of the birth plan was abou getting comfortable. The best my body could do was kneeling over a birthing ball. Being on crutches and monitored throughout (VBAC) reduced my options, but I was in a position that felt more natural.
Choosing a father with a big head. Don't. He's a lovely bloke but his firstborn was incompatible with my pelvis 
Things beyond your control:
Baby's position. I suspect I've gone through the delights of two back to back babies because of my tendency to SPD which makes it very painful for me to keep moving. I did my best second time, it still didn't work.
Genes. My genes are pretty good. That's why DS1 was such a shocker to me. Other circumstances outweighed it.
Your physique. My hips aren't the greatest anyway. They hate pregnancy. I've covered that theme. Being rather petite and giving birth to babies that were 2lb bigger than I was at my birth (same gestation), with the other glitches involved just wasn't going to be fun.
In short it's a lottery. But there are some adjustments that even if they don't tip the balance, can make it easier to mentally process, and that makes a big difference.