At its core a flag system has two parts: an evaluation point in your application and a source of truth for the flag's value. When your code asks is new_checkout enabled for this user, the flag SDK evaluates a set of rules against the current context (user id, plan, country, an internal flag) and returns true or false.
Percentage rollouts work by hashing a stable key, usually the user id, together with the flag name, mapping the hash to a bucket from 0 to 99, and turning the flag on if the bucket falls under the rollout percentage. Because the hash is deterministic, the same user always lands in the same bucket, so a user who got the new feature at 5% keeps it when you raise the rollout to 20%. That stickiness is what makes A/B tests valid.
Production systems do not hit a remote server on every check. SDKs from LaunchDarkly, Unleash, or Flagsmith stream the full ruleset to each app instance and cache it in memory, so an evaluation is a local microsecond-level lookup. Changes are pushed over a streaming connection or polled every few seconds, which is why a flip feels near instant across a fleet.