Yesterday while cooking I set off the smoke detector, no I did not burn anything. They go off when I cook over a high heat. And yesterday once they started going off they would not stop. I ended up having to disconnect them all (they are hard wired with an interconnect) and I replaced them this morning. Aaaaaaaand let me tell you, I had a sleepless night last night knowing there were no detectors installed.
https://www.southernliving.com/how-often-should-you-replace-smoke-detectors-8774122


If you are asleep and your house catches fire, the idea is that the smoke detector will wake you up with enough time hopefully to escape the fire. That is really their primary purpose.
Some European countries do require them. Germany and Britain require smoke detectors in all residential buildings, for example.