Laws: a game of give and take

Part of the reason that laws exist is to protect our rights - our right not to be killed, or to be unfairly imprisoned, or to have our things stolen. But we also have to obey the law ourselves. So do laws both protect us and demand things from us?