First, you are not the only one in the gym. When people are eager to be recognized, they often unconsciously have their own psychology. If you do ten bench presses, I will surpass you and do twenty. Encourage each other and get twice the result with half the effort.
Second, going to the gym can expose you to positive energy, and you are more eager to exercise than at home. You can also make some like-minded friends.
Of course, some people go to the gym to make friends and go to a specific gym in order to get close to some people or join a certain circle. There are many such people.
There will be other reasons, but if the economic conditions completely allow, it is still recommended to go to the gym. The general effect will be more significant than a person exercising at home.
Pure hand tour, hope to adopt.