If they are foiling and still cooking - it is probably to speed up the cooking (if the meat is taking too long) or some think it makes to meat more tender (creates a steaming environment).
If they are foiling after taking the meat off the smoker - That is just so the meat stays hot while resting.
WeberBoy