If it happens once or twice and there is a good story/explanation that goes along with it that is fine, but I actively avoid candidates who switch jobs every year or so. In my opinion it takes a decent amount of time to understand everything within any given company or codebase (especially one that has a decent level of complexity or specialized knowledge). I don't want an unstable environment where people are leaving just as they begin to fully understand things to the point where they are extremely productive.
Along those same lines I think it is the responsibility of an employer to give raises that are equivalent to the salaries they would pay to poach people with a similar level of experience. If you are willing to give someone a significant raise to leave their current company you should be willing to do that for someone within your own company.