Actually the example you provided should have been using table.insert
if mods["Krastori2"] then
table.insert(data.raw["spider-vehicle"]["companion"].energy_source.fuel_categories, "vehicle-fuel")
end
if mods["aai-industry"] then
table.insert(data.raw["spider-vehicle"]["companion"].energy_source.fuel_categories,, "processed-chemical")
end