You can ask "What prompted you to ___?" to find out why someone did something. Specifically, you're asking what event made the person decide to start doing that action.
For example, here's a short conversation:
A: So what prompted you to look for a new job after all of these years working there?
B: Well, they just hired a new manager, who is totally incompetent. I couldn't stand it any longer.
"What prompted you to ___?" is also a little more formal than asking "Why did you ___?"