Again, both are fine from a grammatical/syntactic standpoint, and the meaning is the same. Nevertheless, I'll try to shed some light on the topic.
Had you been there, you would have understood.
If you had been there, you would have understood.
Both imply that the one receiving the message was not there, supplying a contrary to fact scenario for a hypothetical situation in the past. Perhaps the speaker is trying to suspend disbelief, shock or awe to get on with a story.
You could also add some clauses to the same structure. Maybe a teacher is going over test results with a student who did not follow directions:
If you had been there on time for the instructions, you would have understood that you were supposed to show all your work in the test booklet in addition to filling in your responses on the answer sheet.
Other variations might include the conditional past perfect or the simple past in the first clause:
If you would have been there, you would have understood.
If you were there, you would have understood.
I'd use either the If you'd been there past perfect contraction or the simple past, if you were there for informal conversations, maybe leaning toward the past perfect if I felt irritated or wanted to keep an audience in suspense.
For contrary to fact scenarios with results in the present, use the past tense in the first clause and the conditional mood in the present tense for the second:
If you would have been there, you would understand.
If you were there, you would understand.
Note that the mood of the second case above could be subjunctive if the state of being there is situated in the present.