Changing the key in the lock is almost always cheaper than changing it. This is due to the cheaper price of the pins inside the locks, while when a lock is replaced, all new parts are paid for. Because of the extremely low price of lock pins, changing them is almost always much cheaper than changing them. When you change the keys to the locks, you are only charged for labor, while when you change them, you pay for both labor and parts.
Some newer types of locks offer the option to easily change them at home without having to disassemble them or call a locksmith. While “changing a lock” is self-explanatory, it simply refers to changing an old lock for a new one, changing the key requires a bit of explanation in order to understand it. In cases where you have one or more locks installed but don't have the corresponding key, you'll have to compare the price of a new lock with that of changing it without a key (which requires more labor) and make an informed decision about what's more profitable. Without the right key, the only way to re-lock the lock is to open it, and while it's usually not a problem for a skilled locksmith, it often entails additional expenses that can make it more expensive than replacing the lock completely.
Another thing to keep in mind is that if you try to change a lock yourself and don't succeed, there's not much harm you can do to the lock, but if you try to change the key to a lock without success you will almost always ruin it completely. Most people aren't aware that instead of changing their locks, there's a much better and often cheaper solution: putting them back in. Changing the key of a lock means changing the working key of the lock with a different key, without replacing the lock itself. Each series of pins in the lock corresponds to a specific key, so when you replace those pins with different ones, you basically place a new key that will now make the lock work.