The story of the development of the Barrett M82 .50 BMG semiauto rifle is really a neat story - much more interesting than most people probably expect, and reminiscent of many firearms development stories of the 1800s. Ronnie Barrett was working as a photographer in the late 70s, and became interested (perhaps obsessed?) with the idea of a semiauto .50 caliber rifle after a photo session with a Vietnam War jungle patrol boat (which was armed with a pair of M2 .50 caliber machine guns). At the time, the only civilian options for the .50 BMG cartridge were conversions of WWII antitank rifles like the Boys and PTRD.
Barrett, with basically no formal engineering background, sketched up a design and approached some machine shops for advice and assistance. He started working in his garage, and after a couple years had a function prototype completed. He sold the rifles commercially at gun shows and through publications like Shotgun News until making his first military sale in 1989, to the Swedish government. The following year he received an order from the US military, and sales took off from there.
Contrary to common expectation, the Barrett M82A1 is not really a "sniper" rifle - as a semiautomatic design with a recoil-operated action it's potential accuracy is much less than that of a bolt action precision rifle - and this is amplified by the lack of a precision .50 BMG cartridge in US military service. In practice, the M82A1 will shoot about 3 MOA with normal ball ammunition, and about 1.5-2 MOA with good handloads. It is used primarily as an EOD rifle to detonate heavy-walled unexploded shells at a safe distance, and as an anti-material rifle to attack light vehicles and infrastructure at a long distance. These are relatively large targets, which require the large payload of a .50 BMG projectile but not the extreme accuracy of a true "sniper's" rifle.