Hi11 and Sun already gave plenty explanation, I'll just toss in another little bit.
Whenever you get attacked by another player you get a choice:
- accept the challenge and fight (and win crowns regardless of outcome)
- decline and pay the attacker off (small sums based on how much the defending army was worth) but get no crowns
Regardless of how you choose to proceed you get 1 hour attack protection. And yeah, no offline attacks.