Why are my iPhone 7 charge & transfer contact & cable less and less reliable (keywords: loose / defective contact, slack joint)?
It is just dust in the contact.
There was just dust inside the contact of the iPhone coming from carrying it around. The flat charging cable added to the problem, as it can only press the dust further inside. That is why I think it is a specific iPhone-7-upwards problem which you do not necessarily have with other contact shapes. I noticed at some point that I could not put in the cable completely. Then I got the most of the dust out with a plastic-bristled brush. You could not get rid of the dust just blowing at it. With a very thin kitchen knife I could get a ball of dust out in the end, solving this.
I am sharing this though it might be totally obvious. It took me a month to find out, that is why it might still help someone else.