It appears to me the solenoid is for aux start and the yellow wires have been added and probably went to switch or another solenoid or relay used to activate one in compartment.
Maybe this video will help after watching it it may well the solenoid that is used to charge battery and aux start . I know I have a better understanding after watching it
https://youtu.be/wc_vGNHhAYE