The essence of a motorcycle helmet, or any helmet of that matter, is pretty simple. There are two main parts. There's an outer shell made from a tough, strong material such as fiberglass, carbon fiber, or polycarbonate plastic. Inside this outer shell is a thick lining of expanded polystyrene (EPS) like the stuff your fragile computer monitor or other electronics was probably originally packed in. There will be a super-strong strap firmly attached to the outer shell of the helmet that's designed to fasten around your chin so it can't be knocked off in a crash.
During an impact the two main components do two specific things. The outer shell absorbs some of the initial impact force. It deforms around the impact point as it decelerates and also prevents anything from penetrating into the helmet. Meanwhile, the inner shell is compressed by the impact force of your head inside the helmet trying to continue on the path gravity has sent it on. It's this inner shell deformation that actually protects your brain. It's allows your head to decelerate from the impact speed to a stop in a greater distance. This prolonged slowing reduces the forces acting on your brain and skull, reducing the amount of damage and, hopefully, preventing serious brain injury. Though a seemingly basic, function, it's been developed to a very high level by modern motorcycle helmet manufacturers – large helmet manufacturers investing millions of USD in developing a new motorcycle helmet, while some smaller manufacturers with little known brand names invest about a few thousand USD. Some carbon fiber motorcycle helmets can stop a 9mm bullet, while budget helmet let the 9mm bullet pass-through without even damaging or deforming the bullet.
Some motorcycle helmet manufacturers uses and extra stiffening ring around the base of the helmet, and a net-like fiber weave inside the helmets composite outer shell. The inner lining is normally made of various densities of EPS, allowing the motorcycle helmet manufacturer to fine-tune the amount of protection in different points, according to how likely they are to suffer impact, how much area there is to spread the impact force, and how delicate that part of the head inside is. The forehead area of the motorcycle helmet is usually made of stiffer foam than the crown area since the crown has a larger area to absorb the impact.
The most important part of any helmet isn't visible. If your motorcycle helmet isn't the correct size for your head then it can't offer the proper protection in a accident. The worst case scenario is when a motorcycle helmet is far too large, so it can actually come off in a crash. Even if it doesn't come off, a motorcycle helmet that's too big won't absorb impact energy as efficiently, increasing your chances of brain damage. Conversely, if you motorcycle helmet is too small, it can cause headaches and fatigue, ruining your fun and your concentration.