In an incandescent bulb there is a filament of a single metal (or maybe an alloy of 2 or 3). If you run an electric current through it that raises the energy of electrons in the metal to one of many possible energy states. Then quickly they release that energy and "fall" to a lower-energy state. The amount of energy released by each electron depends on what state it was raised to, and that in turn determines the wavelength (and thus energy) of the light re-emitted. Most of those are lower-level states so we measure in macro terms a higher temperature, and in light terms most of that emitted radiation is in the infrared region. In a normal light bulb it is operated hot enough that a bunch of the light is even higher in energy so it covers the visible light region, but that part is still only a fraction of the total energy output - most is still infrared. You CAN get more visible light, and even up into the higher-energy invisible ultraviolet region by raising the filament temperature with more current. However, a hot metal filament also "boils off" some of its metal atoms to the point that it gets so thin at some spot that it just breaks. Burned-out bulb! Happens faster if you operate hotter for more blue / violet / utraviolet.
An LED works very differently. Electrical curent is passed through a solid state semiconductor material "dosed" with modest amounts of contaminating metal atoms. Again, it is these atoms' electrons that are raised to higher energy levels by the current flow; again, they emit light as the fall back to their low-energy normal state, and again the wavelength of that re-emitted light (and its energy) depends on the evergy levels of the excited and low-energy states. But what is very different is that the type of metal chosen to dose the semiconductor material can be chosen very carefully so that very little light is emitted in the infrared region and most is in the visible light region. It also is relatively easy at the design stage to select doping metals to ensure the light includes significant amounts in the higher-energy invisible ultraviolet region. Further, since these devices do not operate at very high tempertures, they do not wear themselves out rapidly.
So an LED device has three advantages. Its light output can be custom-tailored (within limits) to concentrate in the visible region and not waste energy outputting infrared light. It can be made to output ultraviolet much more easily than an incandecent metal filament. And it does not overheat when doing that, so it lasts much longer.
These differences do make it easiler to mislead buyers, though. Almost none of us has the equipment to measure light output versus energy or wavelength. We are used to incandecent lamps and how the appear. We have learned that creamy-white lamps do not produce much blue light and likely no untraviolet, whereas a whiter lamp has more blue and maybe a bit of ultraviolet. We also have learned that if you want a lot of ultraviolet you can get that with special lamp types the cost more and do not last long. But with LED lamps it is possible to make a very white bright appearance without actually having a lot of ultraviolet output, too. So that leaves us depending on the maker to tell us what the lamp does in total, and we have no way to check that personally.