It’s acceptable from toddlers but by the time kids a tweens/teens (maybe even a little earlier) they almost always know the answer and “why”is actually just a complaint.
Why in general can also be an emotionally abusive complaint, for example saying “why did you do that” is often not a question about someone’s genuine reasons but a passive aggressive expression of dissatisfaction.
EDIT: I think around the ages of 6-8 I would more often than not respond with “why do you think?” And later it became a game we would play on car rides where the kids are allowed to ask why until I either couldn’t come up with a reason or they repeated themselves. But reflexive “why” is bullshit.