This question (or a close variation) will come up in every job interview.
Your interviewer wants to know why you are pursuing this opportunity.
Your answer should address:
1) If you are not currently employed, why did you leave your last position?
Your interviewer will be looking for any red flags that you were let go as a result of performance or attitude problems.
In the current job market, layoffs are very common, so there's no reason to feel embarrassed about a layoff.
If you can emphasize that the layoff was a budget issue (perhaps one that affected an entire group or class of employee), this can reinforce the fact that it was not linked to your performance.
Why are you looking for a new opportunity now?
Avoid displaying any bitterness or negativity toward your previous employer. If you have been between jobs for a long period of time, describe the proactive steps you have been taking to improve your skills -- training, volunteer work (this is very important), or consulting projects.
2) If you are currently employed, why are you interested in leaving your position?
Your response should state your positive reasons for seeking a new role and emphasize why you feel you are ready for new challenges that aren't available in your current position.
Make it clear that you have not made the decision lightly. Employers want to know that you are a committed and reliable employee. Again, avoid displaying any bitterness or negativity toward your current employer. Be diplomatic and accentuate the positive experiences and education gained.