You've built a new checkout flow. It passed QA and works on every phone in the office, so you ship it to everyone on a Thursday afternoon. Two hours later the support messages start: payments hang on some older devices. Your options now are a rushed fix or losing orders while you wait for a new release to go out.
A feature flag gets you out of that choice. It's a condition in your code: if the flag is on, show the new checkout, and if it's off, show the old one. What makes it useful is that you control the flag from outside the code, so you can flip it while the app is running without deploying anything.
That splits two things most teams treat as one step, deploying code and releasing a feature. The code can sit in production switched off until you decide who gets to see it.
Roll out gradually
Don't release to everyone at once. Start with your own team, then 5% of users, and watch two things: errors, and the metric the feature is meant to move. Are people finishing checkout at least as often as before? If it holds, go to 25%, then 50%, then everyone. Keep each user in the same group the whole time so nobody bounces between versions. If something's wrong, only a small slice of users ran into it.
Keep a kill switch
When something breaks, turn the flag off and users go back to the old version, and you can fix the problem without a production fire on your hands. How fast that happens depends on how your app reads flags: if it caches them or only checks at startup, some users may stay on the new version for minutes or until they reopen the app. And a flag reverts behaviour, not data, so anything the new version already wrote stays written.
Make a habit of deleting flags once a feature is fully rolled out and stable. Old flags pile up, and soon nobody remembers which ones are safe to touch. Once you're at 100%, check whether the feature actually worked. And if you want to compare two versions instead of just shipping one safely, flags are also what A/B testing runs on.