Foil does a better job of containing smells because it is less permeable than plastic wrap. Use foil to cover a dish with fish, for example. But don't let foil come in contact with acidic foods like tomatoes (in all forms: sauce, chopped, etc), fruits and vinegar because the acid reacts with the aluminum and causes a blue residue which is harmless but doesn't look very good. So, for acidic foods, it's best to use plastic wrap.
For additional information, see Wrapping Food: Foil vs Plastic from Real Simple.