A huge part of a brand drug price consists of research and development costs, and advertising. Drug companies that produce generic versions simply buy chemical ingredients and spend money on production. Thus they can sets lower prices on their products.
Generic drugs are the same drug products as brand, but they are produced and distributed without patent protection. Generic drugs contain the same active ingredients as the original brand drugs.