On my alternator theres a blue wire/connector that goes onto a thread/bolt type thingy lol, basically it kept falling off

the other night my car would not start so basically i tightened this connector on this wire so it would not fall off

and got a jump start and cars been fine since(well 1 day now) and counting , soo do yous think this wire would have had anything to do with my problem ? what is it for troops