I understand the grammar here (past infinitive in latter) but I do not understand what is the difference in meaning. Both seem to express the same, with the latter putting (in my opinion) more emphasis on the past aspect. But it does not help me..
The difference in tense means that the element of compulsion existed at different times and, therefore, acted on different people with different effects.
In the case of "She had to go there" there is an element of compulsion on the actor which existed prior to the action being taken and was the cause of the action being taken. Examples are:
She had to go to the hospital because she was injured
She had to go to the supermarket because she had no food in the house
She had to go to work for 10:00pm because that's when her shift started
She had to go to the probation office on Monday because it was a condition of her bail.
In the case of "She had to have gone" there is not, necessarily, any compulsion on the actor to take the action, the compulsion relates only to the interpretation of evidence, usually by the commentator. Examples are:
She had to have been to the hospital because her leg was in a plaster cast
She had to have been to Glastonbury, she was still wearing a festival wristband
She had to have been to Versace's, she was carrying bags from there.
She had to have been to Los Angeles, her suitcases had LAX baggage tags on them