What can be done when the headphones won't stay seated in an iPhone?
@Gerry was right: there was dust or lint in the jack that was preventing the headphones from fully seating. I couldn't see it, but I used the end of a floss pick to clean it out and that fixed it. The headphones stay in so snugly now that I can actually lift the phone by pulling on them (not that I would do that normally; I just wanted to confirm it really worked!).

Amazing that just a little bit of dust could make all the difference. I'm just relieved that the phone itself wasn't damaged somehow since it's out of warranty.