How do hammer toes differ from corns?

See below. Hammertoes are deformity of the bone. Corns are thickening of the skin which may be caused by the bone deformity.
Dr. Beresh . Hit the nail on the head. It's important to understand a corn is just a symptom. The "disease" is the hammertoe. Anything you do to the symptom will only be temporary. The only way to "cure" the disease is to have surgery on the hammertoe(s). Think of it like tb: it's ok to take cough meds when you have tb, but the cure is only with antibiotics to treat the underlying cause.
Callus vs. bent toe. A toe that has drawn back and no longer sits straight or "flat". Sometimes it's only a tendon that holds the toe in that position, other times there's arthritis involved: these tend to be more rigid, and require surgery if you want them corrected. Corns are the calluses that often develop because of the underlying hammertoe deformity.
Reason and cause. A hammertoe is an abnormal increased contracture or a bending of the toe joint. This most commonly results from a muscle or tendon imbalance which results from the mechanical and structural changes in the foot that may occur over time in some people. This abnormal bending can lead to abnormal pressure distribution causing a potential development of pain, swelling, blistering, and corns.