Historically locksmiths made entire locks, had cutting screws and filing the pins, nowadays the requirement for locks so large it is done on a huge scale, on a cheap production scale. Most locksmiths nowadays repair locks by means of replacement or swapping parts inside the lock, depending on the costs and damage made to the lock. Obviously there are still specialist locksmiths that do make entire stronghold boxes/ safes, used in the likes of banks and other high security buildings, but this now comes at a great expense as each lock is custom build, often by hand to ensure that this lock is unique to that lock, making it near impossible to break entry.
Locksmiths began as a form of science and art, designed to break through locks. Locks are used to secure buildings, rooms, objects, cabinets or any other storage facility, most commonly keys are used to open locks, more recently, in the digital era other factors are used to lock items.
Locksmiths also, cut keys form originals, or replace lost keys to cars and homes. The large part of their business is to design, implement, manage and install both keyed and keyless locks. Locksmiths frequently assess the risk and recommending a lock to ensure the security matches the value of the goods, many high security areas have several security layers which require higher skill to defeat them. Obviously the more layers of security the higher the setup cost to you.
They do not just deal with locks, but tend to specialise in doors and accessories to go with the door, hinges, closers, electric strikes and framework.