Bayonet Lugs
Rifles that accept bayonets have a lug near the muzzle. The bayonet snaps onto the lug with a twist and is firmly locked into place. Some states ban the use of bayonet lugs on rifles.
Rifle Action
The action of a rifle requires several pieces such as the bolt and the barrel to hold their places when firing. Depending upon the action of the rifle, the manufacture depends upon a lug to hold the proper parts steady.
Pressures
The tremendous pressures created in a small space when a firearm discharges is the reason for using lugs. No other method can withstand the constant vibration and pounding.