A generic drug is a copy of the brand-name drug with the same dosage, safety, strength, quality, consumption method, performance, and intended use. Before generics become available on the market, the generic company must prove it has the same active ingredients as the brand-name drug and works in the same way and in the same amount of time in the body.
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), as trademarks laws prevent a generic from looking exactly like the brand-name drug.
Generics are less expensive because generic manufacturers don't have to invest large sums of money to develop a drug. When the brand-name patent expires, generic companies can manufacture a copy of the brand-name and sell it at a substantial discount.