Not at all confusing.
People commonly say now that the Federal Government has exclusive power over immigration. This is incorrect. Article I, Section 9 of the Constitution says that “The migration or importation of such persons as any of the states now existing shall think proper to admit, shall not be prohibited by the Congress prior to the year one thousand eight hundred and eight,” which means that the states’ preexisting complete control over this area of law remained intact until then.
Nothing in the Constitution says that the states’ power in this area ended in 1808. While Congress can legislate about it, recent court decisions in this area have been based on the incorrect assumption that it is up to the Federal Government whether taxpayers of a state must provide illegal immigrants free education, medical care, etc.