Laws themselves do little to protect us. Most of the actual protections we get are governmental authorities who enforce the laws. This is an important distinction because we must not simply look at the laws on the books and assume that they have effect and that they protect the people they are meant to protect.
It is true that laws might protect us to some degree because people will have respect for the law and will not want to break it. We might say, then, that law protects us by setting standards for society which people will not violate. These standards include provisions to protect our lives, our liberty, and our property.
However, we know that laws are very often broken and that some laws (like those giving African Americans equal rights in the late 1800s and early 1900s) are completely ignored. Those laws, by themselves, do not protect us. Laws can only protect us to the extent that the government is willing and able to enforce them.
Laws, then, protect us by setting standards for society and by requiring the government to enforce those standards. However, laws can only protect us insofar as the government enforces them.