The relating hexagram is the second hexagram in a reading. You get it by taking your primary hexagram and flipping every moving line into its opposite: a 6 (old yin) becomes yang and a 9 (old yang) becomes yin. Stable lines stay as they are.
Where the name comes from
In Chinese it's 之卦. Zhī means "to go to." In the oldest consultations on record, told in the Zuozhuan, someone is said to obtain one hexagram "going to" another. That's the idea: the relating hexagram is where the movement leads.
What it shows you
It points to where the situation is heading if the forces at work run their course. It isn't a fixed fate. Think of it as the direction of the wind: it helps you decide how to move, and it doesn't force anything. Some readers also take it as the background or the likely outcome of the question.
If there are no moving lines, there's no relating hexagram. If all six move, the relating hexagram is the opposite one.
An example
You cast Well-Being with a 9 in the third place. That line says there's no level ground without a slope: good times don't last without care. Flip it to yin and you get Fleeting Success. Read together, they ask you to enjoy the good moment while knowing it will pass.
We go through it in detail in The Relating Hexagram.