Settlements are automatically protected by deed guards. A newly-founded settlement gets one guard 'free', while further guards must be hired at a cost of 1 silver each. The maximum number of guards a deed can have is one guard per 7x7 tiles area. For a 31x31 size deed that means a maximum of 19 guards.
Guards cost 1 silver as a one-time summoning fee, and 30 copper per month to upkeep. This price is fixed and does not scale with deed size or guard number. Note that the payment happens continuously in small increments, not one big payment once a month.
Guards will attack aggressive monsters that enter the settlement area, as well as any character with -30 or lower reputation. They also attack any player from any enemy kingdom. Negative reputation is automatically earned when stealing, or otherwise breaking the settlement rules. Citizens with the manage roles permission can also set reputations manually.