In India, one needs to be highly educated and must pass many exams (Called Group 1 Exam) to become an ambassador. In addition, one must be good (looking?) and proficient in what they do. Then they enter the Ambassador's pool. The government can chose ambassadors from this pool only. Exceptions could be made if they perceive someone is capable of handling the job and such situations occurred in the past.
Most countries appoint ambassadors, who are in line with the ruling party's view on relationships. The political party needs someone to navigate the transition remotely, in line with political views. Remember, Ambassadors are the drivers of such change and their interests must be in line with their nations views.
Often, Ambassadors swing by the ruling governments perspectives/views, so we don't see changes. If the government differs, they change the Ambassador. Remember, the government is the king and have sufficient power to do many things.