Four letters compress an older barley storehouse.
Old English bereærn combined barley with a word for a house or store. Middle English bern compressed the compound on its way to barn. Its modern use covers more than a store for that one grain.
Source
Merriam-Webster: barnWord History gives bereærn, bern and the component glosses; current definitions include wider farm uses.