For example, driving by car through a desert is safer in a convoy. If a car breaks down others can help too fix it, and if it cannot be repaired, the people in it can get a ride in one of the other cars.
As for wartime, convoy tactics are particularly important. During the World War One, Lloyd George overruled the protestations of British admiralty and gave an order to organize ships in convoys. British continued the practice during the Battle of the Atlantic (1940) when American supplies were vital for Britain to continue its war effort. Without convoys, U-boat would have needed merely to wait in the shipping lanes for a ship to come along. Convoying increased the odds that a submarine would not encounter enemy targets, and when it did so, the convoy was more likely to have defenders who could either threaten the sub or at least hinder it enough to give the convoy members time to scatter.
There are arguments against the convoy system. The main weakness is that an enemy can concentrate force against a convoy. Once a convoy is found it offers a large number of targets moving at low speed (the ships travel no faster than the cruising speed of the slowest vessel). It was common practice for a U-boat to shadow a convoy and report its course, allowing other attacking units to gather in the path of the ships. The size of a convoy also makes it vulnerable to air reconnaisance and attack, not a problem in mid-Atlantic but WWII convoys to the northern Russian ports were very vulnerable, see Convoy PQ-17. Further, large convoys could overload the resources of the destination port, leaving loaded and now static ships an obvious target for aerial assault.
It has been argued that cargo ships given individual widely-spread courses and travelling alone at their own best speed are less vulnerable to submarine discovery, and if found it imperils only a single ship rather than all the ships of a convoy.