The two components that are painfully obvious about a light are the LED and the battery. However, there’s much more.
First, LEDs can be temperamental. I learned this when I tried hooking up a little LED to a 9v battery. After a little bit, it got hot and the LED stopped working after that. So it turns out that each LED is rated for an average voltage drop and an absolute amount of power consumed. So you need driver circuitry to take the voltage that the battery provides and change that to the voltage that the LED wants.
The simplest way to do this is to use a resistor to absorb any extra energy, however this means that you could waste a fairly large percentage of the energy in the battery making the resistors warm. It works out better to give the LED little bursts of energy so that you don’t exceed the rated capacity but don’t waste so much power.
There are many ways to do this and the quality of this design is what makes a LED light last a little longer and not dim when the battery gets low. Generally, this is built around some microchip, sometimes a heavily cost-engineered one.
Second, There’s also thermal constraints. So even if you get the driver circuit right, if the LED gets too hot, it may fry. So you need to do something with the heat, probably some aluminum-block heatsink.
Next, LED selection and procurement is important. See, because of difficult-to-control impurities and crystal fractures and whatnot, when a LED maker creates a batch of LEDs, some will be brighter than others and the color will vary to some degree. They “bin” these. Plus, there may be several lines available, one with the latest technology, another leftovers from the previous generation. Thus, a LED maker could put an array of 1W LEDs in front of you and each one would be different levels of brightness and color purity, so just because Nichia or Luxeon made the LED it doesn’t mean you got the best bin.
Also, Packaging is important. It’s inevitable that some amount of water will fall on the light, even if it doesn’t get dunked in the ocean. Because it’s generally a motionless seal, you end up using some sort of flexible gaskets that will fill any gaps in the casing to prevent water from getting in. Good design also means that the gaskets will continue to be flexible after a few years of use and exposure to various chemicals. Also, the mounting is important. There are several different possible sizes and shapes of tubing that you would want to mount a bike on, and it’s often nice if you can remove it to prevent theft.
Finally, there’s the switch. This might not be what you want it to be. I have a pile of bike lights with broken switches.