Children are naturally inquisitive. Children behave this way to gain a deeper understanding of something when they are young. As they grow older, they want to understand why you think something is important and why they should feel the same way. Regardless of their age, it's crucial that your child understands that if you set out the rules and expectations at home, they won't be allowed to question them. This is because the consequences would follow.
It is difficult for young children to understand why they need to go home at a certain time from their friend's home. It is also unclear to them why they aren't allowed to play ball in the house. In most cases, however, they strive to make their parents happy and proud. Whenever you tell a child what it is that they cannot play with something or someone or why they must obey a rule you've set forth, why should they not play with it or why they must follow the house rules? Avoid using the term, "Because I said so," as it only makes it more difficult for the child to understand.
You will probably be able to explain this more clearly to older children, adolescents, and teenagers. You should directly, honestly and clearly explain your reasoning when asked "Why?" or "Why not?". This is also a great opportunity for you to reiterate the consequences of breaking the rule. "We do have to go to the dentist's office first thing in the morning for your checkup. If you're not home by 10 p.m., you'll be grounded for a week." Be firm, clear, and consistent.
It shows your child's growth as an individual thinker, even if they question why a rule is in place. You should understand that they are doing it to understand the world around them. Don't be irritated or frustrated when they do so.