Why governments implement protectionist measures?

Why do governments implement protectionist measures?