If you were the owner of a small company and you have two employees who look identical on paper, but one seems to be jumping ship frequently in order to get higher salaries and one seems to be sticking with the same company for years, who are you going to hire?
If I'm giving advice to job seekers, I'd say move around enough to get good salary increases, but don't do it too frequently or potential employers will start to see it as a red flag.
If I'm giving advice to hiring managers, I'd say hire great people, but keep in mind that the best people often get bored or want salary increases, so they tend to move around. If you see someone who has moved around very frequently in the past, then there's certainly a good chance they'll be moving again in the near future.