What online-mode=true does
When a player joins, the server asks Mojang's session servers to confirm that the account is genuine and is logged in. The player is then identified by a permanent UUID tied to that account, which is what bans, whitelists, operator status, inventories and plugin data are all keyed on.
Why online-mode=false is dangerous
With online-mode off, the server believes whatever name the client sends. Anyone can join as your username, and if you are an operator, they join as an operator. Whitelists and bans become trivial to bypass because names, not accounts, are checked.
Password plugins can patch over this partly, but they add friction for every player and do nothing to stop impersonation of players who have not registered yet.
The case where false is correct
Behind a proxy such as Velocity or BungeeCord, the proxy authenticates players and forwards their identity to the backend servers. In that setup the proxy runs with online-mode=true, and each backend runs with online-mode=false and player info forwarding enabled. The backends must then be unreachable from the internet, or anyone can connect to them directly and skip authentication.
Switching modes on an existing server
Online and offline players get different UUIDs for the same name. Switching modes makes every player look new: inventories, positions, claims and permissions are attached to the old UUIDs. Migration tools exist, but it is far easier to choose correctly from the start.