late 15c., "any small charge over freight cost, payable by owners of goods to the master of a ship for his care of the goods," also "financial loss incurred through damage to goods in transit," from French avarie "damage to ship," and Italian avaria. A word from 12c. Mediterranean maritime trade (compare Spanish averia), of uncertain origin; sometimes traced to Arabic 'awariya "damaged merchandise." Dutch avarij, German haferei, etc., also are from Romanic languages. "Few words have received more etymological investigation" [OED].
Thus, when for the safety of a ship in distress any destruction of property is incurred, either by cutting away the masts, throwing goods overboard, or in other ways, all persons who have goods on board or property in the ship (or the insurers) contribute to the loss according to their average, that is, according to the proportionate value of the goods of each on board. [Century Dictionary]
The meaning developed to "equal sharing of loss by the interested parties." Transferred sense of "statement of a medial estimate, proportionate distribution of inequality among all," is first recorded 1735. The mathematical sense "a mean proportion arrived at by arithmetical calculation" is from 1755. Sports sense, of batting, attested by 1845, originally in cricket.