Safety wire (positive wire locking) is done in areas where there is a possibility of the bolt getting loose due to vibration (also in other critical areas); this is done in a way such that the loosening of the bolt is counteracted by the tension in the wire i.e. in case the bolts loosen, the locking wire becomes taut and prevents further movement of the bolt.
Safety wire is used near propeller assemblies where a lot of vibration occurs, or where the different speeds and altitudes aircraft are at could cause expansion or contraction based on temperature. Is it done this way to counter vibration so bolts don’t loosen.
Safety wire is used to keep nuts and bolts from backing off and disengaging rendering the repair useless. All moving parts had to be safety wired if a part had four bolts or nuts and bolts not only were the bolts and nuts wired but the part itself got wired.
Safety wire is used to keep parts from vibrating apart, it also keeps nuts and bolts from loosening from take offs and landings as well as turbulence in the air. Some parts on aircraft create vibrations on their own when the function. (Like hydraulic pumps) it also keeps lines from slipping off! Information reference: https://aviation.stackexchange.com/