It's more than that. It takes into account where the ball came from, whether it was a headed chance or to feet, where defenders are, etc.But XG is just the distance from goal. Hence it is useful over 'many' games, but for one game can be misleading e.g. an open goal from 6 yards versus a rebound at your throat with 8 men on the line from 6 yards.