Here in California, the laws in different California Codes such as Family Code or Civil Code or any other Code are passed by the State Legislature. The Legislature consists of the Assembly and the Senate (these are referred to as chamber). The Assembly has 80 members, while the Senate has 40. The Assembly members serve 2-year terms, while Senate members serve 4-year terms. Members of either Chamber are limited to a lifetime maximum of 12 years in the State Legislature.
Before we have a law, we have a proposed law which is known as a bill. The bill can be introduced by either the Assembly or the Senate. After a bill is introduced, it will be referred to one or more Standing Committees. These committees determine whether a bill should move forward, or if it should be amended. If a bill jumps through this first hurdle, the Committee Phase, it will be returned back to where it came from, whether it came from Assembly or the Senate - which ever chamber in which it was introduced. This chamber will discuss the bill and consider any amendments suggested by a committee or by members of the chamber. Once the bill has been finalized, the original chamber will vote on whether to pass it.
If the bill is passed in one chamber, it will then go through the same process in the other chamber. Sometimes the second chamber will amend the bill and pass a different version of it. A bill will not reach the next stage unless the differences between these versions are resolved. Each chamber must pass identical versions of the bill.
If and when each chamber of the legislature passes the bill, it is then sent to the Governor for review. "The Power of the Pen." The Governor may sign the bill into law, or the Governor may take no action, which means that the bill will become law by default. But, if the Governor vetoes the bill, it will be sent back to where it came from - the State Legislature. The legislature now has the power to vote to override the Governor’s veto and pass the bill into law. But overriding the Governor's veto requires a two-thirds majority vote in each chamber of the legislature. (This is where politics kicks in; blue vs. red) Don't you just love the game and how it is played!
This whole process is extremely valuable to lawyers - we call it the legislative history or the legislative intent and at times lawyers may have to research the history or intent behind the law to augment their persuasive argument in their legal brief to the court.
Of course other than the Legislative branch, laws are also made through the Judicial Branch. We call that "stare decisis." It is a Latin word which means “to stand by things decided”. When a court faces a legal argument, if a previous court has ruled on the same or a closely related issue, then the court will make their decision in alignment with the previous court's decision.