Beef (and Lamb): The surface of beef is often contaminated with pathogens such as e-coli. However, the meat is very dense and the bacteria cannot migrate from the surface into the flesh. Therefore, beef is safe to consume once the external temperature exceeds, 160 degrees F. The internal uncontaminated meat is safe to eat raw.
Pork: Like beef the surface of pork needs to be fully cooked. Unlike beef, pigs harbor a parasitic roundworm called Trichinella spiralis. Infection with the worm is called trichinosis and can be fatal. This worm is killed when the flesh reaches 150 degrees F and is held there for several minutes. Therefore pork is safe to consume when cooked to medium. (Commercial pork in North America almost never has the roundworm present. Almost every case (all?) of trichinosis in the last 15-20 years have come from undercooked wild boar or bear meat). Trichinella spiralis can also be killed by freezing (time and temperature dependent).
Chicken: Almost all chickens have Salmonella or Campylobacter present on the surface (at
least). However, chickens have a less dense flesh than pigs, sheep or cows. Therefore, the bacteria can migrate deep into the flesh. Also, the processing of chickens is much more invasive than the previously mentioned animals which also means the interior meat can get contaminated. This means the meat must be cooked to well done throughout.
Duck: With duck it seems to come down to a matter of processing verses chicken. Also, they are raised in a much less confined manor, which helps prevent the spread of pathogens. There is still a chance of getting a salmonella infection from undercooked duck but cooking the breast well done basically ruins it, so people take the (small) risk.
Ground meat: Grinding meat, by its nature, implies the surface and the interior is mixed. Therefore, one must assume the meat is fully contaminated and must be entirely cooked to well done.