The interviewer wants to understand more about your career goals and how this position would fit into your grand plan. They care about your career goals because they want to hire someone who is motivated, proactive, and likely to stick around and work hard if hired.
If succeeding in this role is important to you as part of your long-term career strategy, you are much more likely to perform well.
You may also hear one of these similar/related questions that are not quite as cliched as the old “5 years” chestnut: