Shields and seals protect the bearing from contamination such as dust and dirt. Shields keep out larger particles. Seals keep out finer particles such as dust.
The best type of seal for protection against dust is the contact seal (as opposed to a low friction non-contact seal) but they make the bearing more difficult to rotate as the inner lip of the seals drag on the inner ring of the bearing.
Metal shields, contact seals and non-contact seals all help to keep lubricating grease inside the bearing. If a bearing is used at higher speeds and oil lubricated by oil jet or oil bath, it should be open to allow the oil to reach the balls and raceways.
Contact rubber seals, although not watertight, also help to prevent liquids from entering the bearing. This is useful in food and beverage applications where equipment is regularly washed down or steam cleaned.