Sometimes it's not even for democracy, but just for overall stability. For example, the recently proposed 240,000 metric tons of food to North Korea to stop their nuclear development.This probably depends on whether the goal of the foreign aid is to get in the good graces of the people or the government. As noted in point 3 of the article, the purpose of foreign aid isn't necessarily to get the US in the good graces of the recipient country (its people or its government), but rather to foster stable democracies.