Colloquially speaking, "to push somebody's buttons" means to irritate or annoy the person. And, "know what buttons to push" means to know what to do to get people to act the way you want.
I can't understand how come "buttons" are associated with people and their behavior. How did these idioms come to be?
Edit: I feel I am not being clear with the question. What I intend to understand is the relation of a person's pysch and buttons. As it is unusual to talk of hurting a machine's feeling, likewise it should be unusual to speak of somebody's button as well. This being my point, how did the metaphorical idiom originate(and considered meaningful)?