“ So when someone says “on what grounds?” They are asking for a reason or justification for something. For example a landlord could say “I am going to evict you” and the tenant could respond “on what grounds?”. But it doesn't have to be used in terms of law, It can be used in a more casual manner.
(Not my written definition)