The purpose of refining edible oils and fats is to remove free fatty acids and other objectionable substances including impurities while maintaining the nutritional value and ensuring the quality and stability of the end product. FEDIOL has developed a Code of Practice for refining vegetable oils (link), on which the description below is based.
This process consistently yields safe products.

There are two main refining processes used on crude oils, chemical/alkali refining and physical refining, which differ principally in the way free fatty acids are removed.