It is important to understand that the vast majority of chemical drain cleaners use sulfuric acid or sodium hydroxide as a main ingredient. These types of chemical are highly corrosive to metals and organic material. These types of chemicals are known as bases, meaning they give electrons to the substance and the hydroxide ions will create a reaction that helps to clear the clog. The alkaline chemicals in turn will release heat and manage to turn hardened grease into a soapy substance which can then slide down the drain. Due to the fact that drain cleaners are heavier than water, they are able to sink through any water that is attached to a clog.
Other cleaners in the market will contain nitrates, bleach and peroxides. These types of chemicals will cause the organic material to lose their electrons and become oxidized.