Children are curious by nature. When they are younger, it's usually because they want to understand everything. When they are older, it's because they want to understand why you think something is important and why they should also feel the same way. Regardless of their age, it's really important that when you start to establish the rules in your household that your young child understands there is no room for going against the rules you establish and what the consequences of breaking the rules might be. That sounds pretty heavy - but the important thing to remember is that you will actually be setting up very few rules and they will only be about keeping safe and being respectful of themselves and other people. Everything else can be negotiated. Everything! Have no more than 5 rules about which you are non-negotiable - 3 would be even better!
Young children usually do not understand a lengthy explanation of why it's important that they be aren't allowed to play ball in the house. But the one thing they do strive to do most of the time is to make their parents proud and happy because it helps them see themselves in a good light. They love you very very much and the relationship between you is one of the most important things in their lives. So when a young child asks "Why?" or "Why not?" when they are told they can't do one of the non negotiable things, simply explain to them that "because it keeps you safe and me happy." You should avoid using the term, "Because I said so," as that only adds to the child's frustration and confusion. As they get a bit older you can add a fuller explanation - but don't belabour the point. They are often not that interested after a minute! But you have demonstrated that you are always willing to give an explanation - even though you may not budge on the rule.
Older children, adolescents and teenagers alike will probably require more from your explanation. When they question "Why?" or "Why not?" it's best to directly, honestly and clearly state your reasoning. "I asked you to be home by 10 p.m. because we have to be at the dentist's office first thing in the morning for your check-up and we can't be late." It is also a great opportunity for you to reiterate the consequences of breaking the rule. "If you are not home by 10 p.m., you'll be grounded from going to your friend's house for a week." Even better is if you have discussed with them what sanctions will be put in place in the family for breaking the few rules there are. Families who discuss these things tend to be very much more successful, happy units. Be consistent, be firm, and be clear.
Though your child may challenge you by asking your reasoning why a rule has been put in place, it also shows their growth as an individual thinker. So get happy and proud instead of angry or frustrated when they do so; realize it's their way of understanding their world around them and finding their own way in it.