There are two main advantages that can make it better to outsource to places that are closer to your main location or your main market.
The first potential advantage is the advantage of cost. It can often be cheaper to transport goods to and from a place that is closer in geographical terms. The lower cost can be beneficial to your firm.
However, this is not usually a very significant factor. A much more significant factor is the time factor. Let us look at the case of offshore outsourcing from the US. If a US company outsources its production to China, it will come to have very long turnaround times for any changes it might want to see. Even if transportation costs from China are not particularly high, the time required is weeks longer than transportation from Mexico or from the United States. This means that closer outsourcing makes the firm more agile. It allows the firm to respond to changes in demand from its consumers in a matter of days, not a matter of weeks. This greater flexibility and ability to change is the main benefit of outsourcing to places that are geographically closer.