I will try to provide intuition how to look at those tenses in English. Please, by no means treat it as complete, especially because that's a quite complex topic. Also, keep in mind I'm not a native speaker.
The perfect aspect works more or less like this: you fix a point in time, and from the perspective of that point, you look at some interval starting in the past and continuing up to that point, no matter if it's stated explicitly or if it remains implicit. (#)
When you say
(1) I hadn't had anything in common with her, so we quickly lost contact.
it sounds (to me) as though you're dividing the past into sort of two parts: a point in time – you two getting out of touch (which I shall refer to as "the divisor" henceforth) – and whatever comes before. The fact that you're using a past tense sets the timeline in the past, while what the perfect aspect does is it highlights this division of time, or rather the relation between those two parts.
It's sometimes ambiguous as to what exactly the speaker means (do they mean a specific, single point in time before the divisor, or do they mean something more continuous, e.g. a span?); however, context is usually enough to decipher what the intended meaning is.
On the other hand, the sentence
(2) I didn't have anything with her, so we quickly lost contact.
doesn't have that nuance. You treat both those clauses as part of the same past. That doesn't mean you forget about the order of events – by no means – but the fact you're not using the perfect aspect changes the way the listener will most likely interpret what you say: you no longer highlight that division in time.
As for the exact meanings of those sentences, or rather the way I see them, I'll provide the explanation for the equivalents in the present tense. That should make things a bit easier.
(1') I haven't had anything in common with her, so we're losing contact.
(2') I don't have anything in common with her, so we're losing contact.
In this case, the way I see is (1') is:
(1'): I haven't had anything in common with her [for some time], so we're losing contact.
What the perfect aspect does here is it focuses on the relation between the past (but continuing up to now; see (#)) and the present. The fact that you haven't had anything in common with her for some time makes room for interpretation that you might have had something in common before. In the end, there's a reason you're using present perfect, right?
On the other hand, (2') is much simpler: you basically state a fact – you don't have anything in common, and the result is you're losing contact with each other. No additional nuance, probably no additional thinking on the listener's side.
It works the same with past tenses.
The second example you provided is a bit different. There is no difference in meaning between those sentences. And here comes out the more inconsistent, I believe, part of past perfect. Most textbooks teach that when there is an event before some other one, and both of them are in the past, you use past simple for the more recent one and past perfect for the other. (Keep in mind I'm simplifying even this part.) That is true, you can definitely use it that way. However, English is constantly changing, and the number of people who use past perfect in situations like this is decreasing, or so has been my experience. If the meaning doesn't change, why would you use past perfect and add one more word (or sound after contracting "had")? What's more, it's definitely less natural for the majority of speakers. I think that's exactly why it's been getting replaced by past simple. To add one last comment to this already overly long message, I'd say American English is where this change is more commonly seen, while, for example, British English remains more "traditional". Of course, there's always room for personal preference.
I want to reiterate that I simplified how it all really works – both because I'm but a learner myself and because it's a really complex topic in general – but I hope you've got something out of it.