A machine gun is a fully automatic projectile weapon. Usually when the term machine gun is used, it is referring to a high caliber weapon of some type. (Generally anything of 5.56mm and less is considered small arms, although technically any weapon providing fully automatic fire could be referred to as a machine gun.)
It's primary role in a ground-combat situation is to provide suppressing fire on an opposing force's position. This forces the enemy to take cover, thus either halting an opposing offensive, or allowing allied forces to move onto the field with a lesser degree of danger.
To this end, most machine guns are not designed for point repeatability/accuracy. On the contrary, most are designed with a small degree of inaccuracy, in order to lay down a spray of fire over an area. This is referred to as a "cone" of fire, due to the way the rounds spread out, and fall over the target area. This is not true of all machine guns. Many of the M2 .50Cal machine guns are so accurate that they can actually be used to snipe targets at great distances, although the morality of this practice has been questioned.
Most modern machine guns operate by utilizing a blowback method, where a portion of the expanding gas produced by firing the weapon is diverted to overcome spring tension and push the bolt back to accept another round. Mechanically, this motion at one and the same time removes the used round casing, and immediately slots another round into position. Spring tension then forces the round and bolt back into the firing chamber. This entire cycle takes a fraction of a second.
Usually, the speed at which the weapon fires is determined by a regulator, which controls the gas flow back to the bolt. The greater the gas flow, the faster the weapon will fire. Most high speed machine guns have interchangeable barrels, which must be switched out periodically to avoid overheating. The higher the rate of fire, the more often barrels will need to be changed out and allowed to cool off. To minimize this, most weapons are not fired continually for long periods of time, or at the highest rate of fire.
Not all machine guns operate in the same way when it comes to the striker. In some, the act of seating the round into the chamber also fires the round off, such as the grease gun used in World War II. In some others, a separate step in the firing sequence is needed to strike the round. In weapons where the round seats and fires at the same time, mechanical timing is essential for operator safety, to prevent the round from firing before it is seated properly. This is especially important in weapons like the 40mm grenade launcher, where high explosives are present in the rounds being fired.
Machine guns operate by means of one or more mechanical sears. When a sear is in place, it effectively stops the bolt at some point in its range of motion. Some sears stop it when it is locked to the rear. Other sears stop the firing pin from going forward after the round is locked into the chamber. A sear that is found in almost all weapons is the safety, which simply keeps the trigger from engaging. Typically, the act of pulling the trigger both strikes the primer on the round in the chamber, and dis-engages the sear or sears, allowing continual cycling of the bolt until the trigger is released and the process is stopped at some point in the cycle.
See World War I