I've read both the Nxt whitepaper and many other resources on the wiki but I still can't seem to understand how exactly the forging process works. From what I understand, there are a bunch of online users with their account "unlocked" (so they can sign the next block if they win). I don't understand how the winner (or the next forger) is decided. Is it random, or is it based on how many nxt coins one has?
For example let's imagine there are three users online with their accounts "unlocked": Alice (has 40 nxt), Bob (has 55 nxt) and Fred (has 13 nxt). The wiki says:
Your probability of forging a block depends on your share of the total number of coins that are active on the network.
If that's true, wouldn't Bob (who has more coins than Alice and Fred) win the block generation every time? But then how is it possible that even accounts with little coins are still able to win at forging? Does it have something to do with the fact that the winning forger has to wait 1440 blocks before they can forge again? Is this what gives a "chance" to the less-rich users to win sometimes?
Also, if Bob is winning every time, couldn't he just go back the last 10 blocks or so and replace them with different blocks?