An interviewer asks about your old job to assess "fit." If you were unhappy because of something that will be a part of your new job, a recruiter will be less inclined to hire you, fearing you will leave or underperform. The most effective response to this question is straightforward and focused on the new position.
There is no point in trying to avoid the question. If it comes up, you have to respond; and you should respond honestly. Your references will be checked, so it is likely that your new boss will find out what your old boss has to say. If your story goes beyond a mere difference in perspective, it will send up red flags for your interviewer.
Even if you had a horrible job experience, you should be positive when describing it to your interviewer. Bosses and employees often see things differently; if you speak ill of your previous employer, it may make your new employer worry that you will eventually say bad things about her. Focus on objective things. Emphasize that you exhausted all of the challenges in your previous position or it did not allow you to use your full skill set.
An interview is focused on the future, not the past. Do not belabor the question about your last job. If you spend too much time rehashing details, it can make you seem ill-at-ease. To give a concrete but short answer, go beyond simple assertions. Instead of saying a job was "not a good fit," elaborate by saying "my skills shine in a team environment, and my last job focused more on individual projects."
Your interviewer wants to know if you are the right person for this job. In every answer, you should be targeting the skills she is looking for. When you say your last job did not afford you enough team-driven opportunities, connect that to what the new job will entail. Express this as "the position at your company focuses on collaborative work, where I do my best work for employers."