"Can someone explain to me why in non-PVP servers in WoW, I see messages saying a town is under attack? "
Because the town is under attack.
Half of the NPCs are PvP flagged. Once the opposing side attacks one of them (or perimiter guards are agroed) the call goes out. Once you attack a PvP NPC or Yellow enemy you are PvP flagged for five minutes. The only way to clear your pvp flag is to not engage in any pvp activity for five minutes.
Theoretically you could destroy a town by nailing all the guards and NPC vendors.
This is what's called a Raid on the PvE servers, and it is very, very fun.
They are all PvP servers - it's just some are non gank PvP servers.