There are at least two situations in which it can be a good idea to hire from outside the company.
First, it can be a good idea to do this if hiring from within the company is likely to cause conflict among employees. If you hire from within, you will be promoting a person to manage people who used to be colleagues. Some of them might even have applied for the job and might be very angry if they do not get it. They might feel that they are just as good as the person who got the job. In such cases, it may be better to hire from the outside.
Second, and perhaps more importantly, it can be good to hire from outside the company when you feel that there is a need to change the culture of the firm as a whole or of the unit in question. If a firm or a unit has been stagnating, it may make sense to bring in an outsider. That person will not be weighed down by their experience in the old culture of the firm or unit. They will be able to provide a fresh outlook on the problems that face the firm. This can change the culture for the better.