Where does intellectual property come from? Different places. Trademarks come from the U.S. Constitution — Article I, section 8, clause 3. It says Congress shall have the power to “regulate commerce with foreign nations, and among the several states.”
Trademarks are part of a broader set of laws that prohibit unfair competition. Unfair competition laws prohibit things like counterfeiting and mislabeling goods about where they’re from or what type of of product they are. Congress can regulate trademarks and unfair competition because it has the power to regulate commerce.