For many people, the two are deeply intertwined and often share a root cause: The need to feel like a capable agent in the world. Anxiety is your brain saying, "You need to do something, but you're going to screw it up so obsess about how to avoid that!" Depression is your brain saying, "You need to do something, but it won't help anyway so just give up." I'm over-simplifying, of course, but the gist is that we're wired to want to do and we feel bad when we aren't doing enough or what we're doing doesn't matter.
The modern world is antithetical to that. We are surrounded by media that provides short term gratification to consume but involves absolutely no action or agency on our part. After an hour of TikTok scrolling, our body and subconscious is screaming that we should be doing something. Punching a time card at a bullshit job burns all of our energy but provides no meaning in return.
Physical activity addresses that. It's both good for us at an actual kinesthetic level, but it is also the strongest, simplest signal that we can send our brains that, "Look, I am an active functional agent in the world."
I like to imagine Martians setting up a human zoo. If you were building a zoo for any kind of animal, you'd certainly make sure the animals had plenty of room to move and explore. You'd give them things to do, and make and move. If it's an animal that digs, you'd give them dirt to dig. If it builds nests, you'd give them twigs. You sure as hell wouldn't stick them in a tiny box with a screen and a button that just changes what's on the screen. That would be torture.
Martians building a human zoo would give us room to walk and run and explore, materials to craft with, and other humans to connect to emotionally and physically.
Instead, many of us have put ourselves in that dumb empty box with just a screen or two, and then we're surprised when we don't feel good.