In the United States, each individual state will have its own state laws which are intended to promote the overall welfare of the state. However, even though state law is often times different from federal law, the United States as a country is ruled under federal law.
State laws were created as a result of the reasons behind the American Revolution. Because it was a concern to implement a government that had all the central powers which could lead to a tyrannical rule, states were allowed to devise state laws to provide for the governing of the people within such states.
However, even though state law applies to each different state, It is the United States Federal Laws which rule the country as a whole. Furthermore, state laws and federal laws differ in the sense of the certain areas in which they apply. For example federal income tax concerns are governed by the federal laws, though matters such as marriage and divorce are overseen in state law.