Machine Guns are slow-moving infantry teams, which are defenseless while packed. Like Artillery Weapons, they need to deploy before being able to attack, and pack before being able to move again. When deployed, they provide extremely effective long-range firepower against all kinds of infantry. They are pretty useless when fighting anything else, however, and can be taken out easily by sending Ranged Cavalry, Tanks, or Fighter Aircraft against them.
Machine Guns are supposed to be used in more defensive situations, like when defending a (captured) city, a fort or a rare resource against raids from enemy infantry. They should be complemented with anti-tank infantry against vehicles and Anti-Aircraft or stationary AA defenses against air raids.
Machine Guns' production cost increases progressively with every Barracks unit on the field or currently in production. The default increase is of 10 Wealth and 10 Metal for the second unit created, increasing further with every new unit until the cost cap is reached, which for military units is +125% of their original base value.