The completions are generated using Bash's existing completion framework (commonly scop/bash-completion or your own completion scripts). And if you don't have a completion script setup, flyline will try to synthesize one on the fly () using man pages or --help output!
This is similar to https://github.com/microsoft/inshellisense but inshellisense only works for a hardcoded list of completions specifications and runs in a different process as Bash.
Flyline has a bunch of other features, so if you're interested you can check it out here: https://github.com/HalFrgrd/flyline. Thanks!