This rule is part of a set of decrees instituted by the rabbis of the Talmud to prevent intermarriages with non-Jews. The purpose of the rule is explicitly to inhibit socializing with non-Jews. The prohibition of bishul akum applies to a formal meal prepared exclusively by non-Jews, even if the situation was one which had no other kosher food problems.
The prohibition applies only if the food is prepared exclusively by non-Jews. A small amount of Jewish participation can suffice to keep the food kosher. Different rabbis have different views on the absolute minimum: Sephardi poskim state that the minimum participation is to light the fire and place the pot on it to cook, while Ashkenazim are satisfied with merely lighting the fire, or even making a slight adjustment to a fire which was already lit by a non-Jew.
The law applies only to foods which, according to the Talmud, are "fit for a king's table" (and could not be eaten raw). Foods which would not be served at a state dinner are exempt from bishul akum, and are kosher even if cooked totally by non-Jews, provided that all the other requirements of kosher food are met. Maimonides explains that this prohibition was originally decreed in order to avoid a Jew being invited over by a non-Jew for a meal (which may lead to intermarriage), and people do not invite each other for dinner over food which is not "fit for a King's table" (Maimonides, Ma'akhalot Asurot 17:15).
In contemporary observance, the mashgiach, along with supervising food preparation, typically helps start the stove and/or provides other participation in the cooking sufficient to ensure that the rule of bishul Yisrael is complied with. In situations where bishul akum would present a problem, our Chachomim have instructed us that this disqualification can be avoided by having the observant Jewish homemaker or a mashgiach, a kosher supervisor, perform an integral part of the cooking process, such as turning on the fire. When a Yehudi, an observant Jew, assists in the preparation, we say that the food is prepared through bishul Yisroel.