That's all perfectly clear. I just started the game by playing maps in "Single Player" mode instead of going through the campaigns. I played a few maps and didn't earn any coins. Then I decided to try the campaigns, and now I have about six thousand coins, but there's not much to buy with them (titles, portraits, and the only somewhat worthwhile thing, dynasty traits).
And some of the coins are awarded for completing tasks on both campaign and single-player maps, for example, winning a certain number of battles without using magic, or winning without any losses, etc.