A doctor presses or pushes on your stomach during a physical exam because the doctor is looking for any potential tenderness or pain that you might feel when the doctor pushes on your stomach.
If you have pain when the doctor pushes on your stomach it can indicate inflammation of the membrane that lines your bellies cavity.
When your appendix becomes diseased the membrane of the bellies cavity can become inflamed so that's one reason why the doctors push on our stomach.
The doctor could also be checking for other stomach issues when they push on your stomach because the feeling of your stomach can indicate any potential health issues that need to be treated