Hydrocodone and codeine are NOT the same chemical compound; they're two different drugs.
Codeine is the 3-methylether of morphine. It's almost inactive on it's own, and needs to be converted into morphine via the enzyme CYP2D6 in the liver to cause opioid effects, hence it's a prodrug. The Schedule 4 version of Codeine (syrups, mixed as analgesic with other drugs like Tylenol) is still a pretty weak opioid painkiller and severe pain will typically require something stronger. The Schedule 2 version is an extremely strong opiate, but isn't typically prescribed to most patients; the Schedule 4 version is.
Hydrocodone's chemical structure is similar to codeine's but not the same. It's a great deal stronger than codeine and is hence more effective in reducing severe pain. Hydrocodone also has less severe side effects, such as itching and nausea, than codeine.