I have two older iPhones I rarely use but I still need them occasionally for a second camera or display for a Bluetooth device. Both got new batteries.
If you leave it in a drawer at 50%, the voltage will drop down on its own to almost nothing in several months. That's bad.
The perfect voltage to store the iPhone is at a 40% charge at a cool temperature. (fridge is ok if kept in a sealed plastic bag). But the moment you turn it off (at 40%) it slowly starts discharging on its own even though it's not being used. So it's better to store it at 50-60% charge to give it a little leeway to discharge. Any voltage below 40% is a bit harmful to the battery too during storage. Having it sit below 40% for months at a time isn't good for it either.
So the best way to take care of the battery is to start the iPhone every month to check its state of charge and top it up to 50% before putting it away again. Don't let it sit unused for more than maybe 2-3 months.