Most bikes have an aluminum derailleur hanger that extends from the rear dropout. The rear derailleur connects here. This part is designed to bend if the derailleur is impacted, rather than damaging the frame. However once bent, it can disrupt your shifting.
A derailleur hanger tool attaches to the derailleur hanger, where the derailleur is fixed. There is a gauge to check it's distance from the edges of your tire rim. Use the tool to unbend the hanger until the gauge is equidistant at all points.
If your gears are skipping or not indexing correctly and adjusting cable tension doesn't fix it, it's a good indication of a bent derailleur hanger.