Drug manufacturers hold patents on the brand-name drugs they make and sell. When the patent expires, pharmaceutical companies can manufacture a generic, or copy, of the brand-name and sell it at substantial discounts.
A generic medication has the same dosage, safety, strength, quality, directions, performance, and intended use as its brand-name counter-part. Before generics are made available on the market, the manufacturer must prove it has the same active ingredients as the brand-name and works as effectively. The only differences between generics and their brand-name counterparts is that generics are less expensive and may look slightly different (eg. different shape or color). Trademark laws prevent a generic from looking exactly like the brand name medication.