OP wrote " I use Google Chrome " and " I saw other entries saying that the same problem happens with Safari as well so I'm guessing it's an Apple problem rather than the browser. "
I use Safari Version 18.5 (20621.2.5.11.8) on Sequoia 15.5
Websites like Banks, Financial Institutions. Governmental Financial Website, and other Secure websites often employ a " Log Out for Inactive "
This is done for Security Reasons and totally expected
As from Google Chrome versus Apple Safari web browser
Google Chrome is will designed by the Developers to do what it does
To quote contributor @ John Galt
" There's nothing wrong with Brave. It's Chrome without the Google. I use it for certain websites and it works fine on Macs and iOS devices. There are other Chromium-based browsers as well; I'm just not as familiar with them.
If efficiency (power efficiency, resource utilization, performance optimization) is important to you, then nothing comes anywhere close to Safari. Apple specifically developed Safari for those purposes as well as other no-compromise requirements such as standards compliance, privacy, iOS / macOS integration... all things that matter to Apple and Apple's customers.
The essence of your concern was memory utilization, and it's no secret that Google will greedily take all of it to itself.
Cant just leave it quit on my mac?
That won't help because we cannot install Chrome on a Mac without installing Google. To be blunt about it Chrome is the Trojan that infects your Mac with Google. Google doesn't really care about Chrome; it's your personal information they're after. It's the closest thing to a macOS "virus" that there has ever been, or will ever be. The only significant difference it and a true "computer virus" is that Google is hiding in plain sight, and it is easily removed. "
End Quote