When applied to [gun]s etc, the barrel is the usually metal pipe through which a controlled [explosion] is released in order to propel a projectile? of some kind out of the end at great speed. The first guns were made in a time where metallurgy was not quite what it is today, hence the pipe needed to be braced periodically along it's length, somewhat reminicent of a barrel.