Why would two circuit breakers be connected inside the service panel?
As @Ecnerwall says, definitely not safe / legal / advisable.

My guess is that the guy kept tripping breaker #4 (maybe too many power tools in the garage?) and decided to share the load with another breaker by adding the extra wire. Approximately half of the current will flow through each breaker, effectively creating a 40 amp breaker.

EDIT: in fact it's possible / likely that the wires on that circuit were regularly carrying more than 20 amps. Wherever possible you should inspect the wiring, including all outlets on that circuit, to see if there are any signs of melted insulation or other damage. If you find any indication of heat damage I think it would be prudent to rip out the entire circuit and rewire it, since there may be damaged insulation in the walls just waiting to catch fire.