Why do they serve onion + lemon before a meal?

Hello guys, I'm a tourist visiting different places in Maharashtra and I noticed that all the restaurants I have gone to, they serve cut onions and lemons before a meal / even ordering.

This is new to me as I'm from South India.

Is there any purpose to it?

If I have to guess, I think it serves to keep the hungry customer occupied until their order arrives.

Thanks!