This is both not so complicated but also quite confusing..
The weight and inertia values you enter in the HDV file are for the entire car. However there is more than one mass, because we have the main car body and 4 corners worth of unsprung mass (tire, wheel,spindle).
If you enter the total values and the individual unsprung mass and inertia values, you can find the mass and inertia of the main car body by subtracting the unsprung from the total.
They do this by figuring out what the inertia of the tire/wheel/spindle is relative to the center of gravity of the main car body. If the front left tire in a top view is 2 meters away from the car CG and one corner worth of unsprung weight is 35kg, then the yaw inertia this one wheel has around the car CG is 35 * 2^2 = 140. Do this for all wheels and spindles and you a value of 560. Say you entered a mass of 1000kg and a yaw inertia of 1500 in the HDV. Now the game knows 560 inertia is from the unsprung bits and that means 940 is from the car body. The main car body mass becomes 1000 - (35*4) = 860. There, each body is defined, physics will make sense!
In, probably, all rFactor derived sims, most likely up to the Superleague game which came out in ummm 200x, this 'working back the inertias' code has an error in it. It calculates the unsprung inertias by doing mass * distance, instead of mass * distance * distance.
Lets do it the old (pre Superleague way) and new (post Superleague game) way:
RF1: Car body yaw inertia = 1500 - (35*2*4 corners) = 1220
AMS: Car yaw body inertia = 1500 - (35 * 2^2 * 4 corners) = 940
I.e. in rF1 and other older versions of the code, the effective total yaw inertia of the car is too great, and the car will turn a bit more sluggishly than it should, provided the distance from the main body CG to the unsprung masses is greater than 1.
This also means in roll, where if your track widths are typically 1.5 meters, the distance to the CG is 0.75 meters and the error goes the other way. Say roll inertia in the HDV is 100
RF1: Car body roll inertia = 100 - (35*0.75*4) = -5
AMS: Car body roll inetia = 100 - (35 * 0.75^2 *4) = 21
RF1 will crash as it will try to apply 100 - 105 = -5 worth of inertia to the main car body
AMS will work as expected and there is 100 - 79 = 21 left for the main car body.
This is quite important when making karts or worse, scale model cars as this incorrect compensation error can lead to the game crashing or behaving oddly.
HOpe that makes some sense, I spent way too long trying to explain it!