How exactly do you get hives?

An allergic reaction. Hives occur when mast cells release histamine. Histamine makes nearby nerve endings fire causing the sensation of itching & iincreasing blood flow causing redness. Small veins leak plasma (the liquid part of blood) causing local edema - that's the white bump. Hives lasting 6 weeks or less are usually caused by a virus or an allergic reaction to a food, medication, insect bite or sting.
Many Reasons. Hives which are short lived or chronic are common and can occur for many reasons. A common reason for short-lived hives are infections. It may also occur as an allergic reaction. It may or may not occur with swelling. If hives are chronic, a reason is usually not found but it can occur with autoimmune conditions.