UsdResolveInfo is meant to inspect where an opinion comes from. It's mainly used in usdview to display information about properties to the user, covered on the usdview_style_documentation page.
stage->GetPrimAtPath(pxr::SdfPath{"/Foo"}).GetAttribute(pxr::TfToken{"bar"}).GetResolveInfo().GetSource()
stage.GetPrimAtPath("/Foo").GetAttribute("bar").GetResolveInfo().GetSource()