When something's legal, or the rules allow it, you can call it lawful. It's lawful to plant a tree in your yard, but it's not lawful to dig up a tree in the city park.
Things that are lawful are allowed or permitted, like driving after you've gotten your drivers license or baking your neighbor a cake. Neither of these things is prohibited by law, so they're lawful. You have a lawful right to build a cabin on land you own, and it's also lawful to put up a fence. The adjective comes from law, which has an Old English root, lagu, "ordinance, rule, regulation, or a district governed by them."