I think it's a gross mistake that bicycle manufacturers generally fail to include lights that are powered by one of the main power sources of the bike.
For non-electric bikes, this means lights powered by muscle power, i.e. hub dynamo lights. The most expensive component, the front wheel, can be stolen but you can lock it with cable and a dynamo front wheel is not that much more expensive than a non-dynamo front wheel so having dynamo won't increase the probability of theft all that much. Also for QR hubs you can use these five-sided Allen-like security skewers that are harder to steal since few people have the tool required for stealing them. (Unfortunately thru-axles have so many standards and it's very unlikely you will find compatible ones for thru-axle frames and forks.) The less expensive components, front and rear light, can be stolen with ordinary tools but they have little market value since few people are looking for a used bike light, but lots of people are looking for cheap used bikes (that could actually have been stolen). Also the factor that a front or rear light without its power source is about useless as a flash light makes theft less likely.
And in case you fear dynamo drag: a powered-off hub dynamo creates about 1 watt drag at typical speeds, and has 50% efficiency when powered on so for 3 watt light there will be 6 watts of drag. The best bicycle tires, those intended for racing bikes, create more like 20 watts of drag at speeds casual cyclists ride (at racing speeds the drag is obviously more). The drag is almost non-existent. Besides, whatever little speed you lose to 6 watts of drag is maybe 0.47 km/h (according to a simple bike speed simulator I have written). After riding 100 kilometers, 5 hours, that's about 7 minutes. How much time would you use removing the light every time you stop at a grocery store, putting it on your bag, putting it back to the bike after continuing riding? How much time would you use charging the light at home? Well I suppose if the 100 kilometer ride is one continuous ride, then it would be faster to use a battery light and charge it at home.
For electric bikes, I think it's more logical to power these lights from the e-bike battery. Typical battery sizes are 500 Wh that give about 160-170 hours of light. Good e-bike systems, when the lights are on, cut electric assist at 5% battery remaining or so, giving still over 8 hours of light for you so certainly you won't be stuck in the dark. These, too, require the power source so same considerations apply as for dynamo lights: stolen lights don't have the kind of market value that stolen bikes have.
A typical battery light, in contrast, has to be removable to be practical. It has to be removable or else if it's AA light it's probably very hard to change the batteries, if it's Li-Ion light the battery can be non-removable so the entire light has to be removable, and anyway if the Li-Ion battery is removable, it's probably much easier to remove the battery for charging if you can remove the light from the handlebars.
And even though if a battery light manufacturer has magically made a light that's permanently mounted on handlebars, not removable with tools, and has managed to make it very convenient to change the batteries, still it's useful if it can be stolen with tools, since it can be used as a flashlight.
Switch to dynamo or ebike lights. You won't be disappointed. I have made the choice that not a single of my bikes lacks lights powered by one of the main power sources of the bike.