Horseshoes were invented to protect horses' feet but are now used for protection, for traction, to improve gaits and to mitigate soundness problems.
Horseshoes were invented about 2,000 years ago when horses were domesticated. The work the horses were doing wore off more horn than the horses' feet were growing. (The horn is the outer covering of the hoof, similar to human fingernails.) The shoes were added to prevent as much wear as possible.
Horseshoes are still used to protect a horse's feet. Some horses have strong enough feet to go without them, but horses ridden on hard, rocky or very soft and wet ground usually need them. Also, some horses have naturally weak feet.
Even horses with good hooves may wear shoes if more traction is needed for the ground where they typically are ridden. For some disciplines, such as eventing and racing, horses may need more traction in wet or deep conditions.
Shoes can be used to improve a horse's gaits. This can be used for competitions and to correct gait abnormalities in horses with conformation faults.
Horses that have suffered soundness problems, such as laminitis, navicular and long-toe/low-heel disease may need shoes in order to be comfortable. Shoes may be used to correct the shape of the horse's foot, if necessary.