The value_of_rec version is recursive, so that for fvar<var<double>>, it returns double, while value_of would return var<double>. As to when one should use one rather than the other, I’m not clear either.
We need value_of inside operands_and_partials in order to get higher-order derivatives right. We can use value_of_rec in most other places. If you implement a function for all types, then you can recurse with value_of or go all the way at once with value_of_rec if you know you’ll eventually need a primitive value.