These are a part of your standard safety equipment. You need them to notify passers-by and potential rescuers when your life is in danger. You can get into very risky situations while on your boat, with no help nearby.
Even though nowadays you are recommended to call for help using VHF radio onboard (if it’s reachable and in function), emergency flares can still be useful because you can light them up and allow rescuers to locate you quickly when they are near.