Building codes govern how buildings are constructed to meet minimum life safety standards. The officials who write the codes will tell you that the codes are not intended to protect property, but to make certain that the occupants can exit the building without harm. Building codes are typically politically benign, that is to say, they are not arbitrary.
Zoning codes were initially intended to protect property values. Early zoning codes divided communities into use areas such as residential, offices, retail, industrial, or agricultural. Many communities still use these. The newer form-based codes divide communities into areas, often with mixed uses in each area. They often come with stringent requirements that are designed to force a certain predetermined outcome, hence the name form-based. These codes are very political in nature because they tend to reflect what certain officials desire, not the end user. They can be very difficult and expensive to comply with.