Defense or defence is protecting something from attack. Defenders have advantages over attackers. They can use fortifications and weapons that are too large to move. The defending side in an air battle can have help from anti-aircraft warfare.
A country's government may form an army a navy and/or an air force to protect the country and its people from attacks. The army, navy, and air force can also be used to attack other countries. A Country can also use the military to kill or arrest people, or members of groups, from other countries who have hurt or killed their own citizens.
In these groups, people are specially trained to use weapons such as rifles and artillery, that can be used in war to kill other soldiers and destroy their equipment. Together, these groups form a country's military. Governments spend large amounts of money every year to buy and keep weapons and to pay people to defend their countries. These trained military people are called soldiers.
A country's armed forces can also be used for non-defense jobs, in many kinds of emergency.