Should a thesis advisor be an onlooker or somebody who struggles with the problem? I am asking about research in a Math department, although I believe the question generalises to other departments.

I would like to know what a potential thesis advisor should be like. Should the advisor be somebody who is experienced, is quite famous but nowadays usually supervises the works of his students as an onlooker and does not really work on the same problem? Note, he still studies his area but does not publish anything by himself recently. Or should he be somebody who fights along with the PhD student on a problem, and they share ideas and attempts, and both are active in this?

In the first case, I have heard that the experience of the professor matters and his fame will help in getting a placement much more easily. Also he would want me to learn, and trying the same problem with me would tilt the scales towards him since he would come up with ideas more quickly than me due to his experience. As a result, there is a chance the work would become primarily his. But isn't this the thing to look out for? Why would I have somebody as my advisor who doesn't work on my problems, (but who has worked on these previously) and merely tells me references and guides me to papers or books when I get stuck? How exactly am I learning from him, then?

Personally, I would prefer somebody who may be young, but who is motivated enough and willing to spend hours with me discussing things and working together on a problem, rather than somebody whose aim is to "help" me do things by giving suggestions, most of which he hasn't read completely (which usually happens). He should be my friend and together we should explore the frontiers of human knowledge. But that's my opinion. If I manage to get my degrees, maybe I would try to be that kind of an advisor to my students, and if I cannot, I would tell them straight away.
I am not sure which type of advisor is better. It probably depends on the individul or is a combination of both extremes. However, I think that, in the absence of finding all good qualities in one individual, a PhD student can build a team of mentors and coauthors. 

Your advisor is one type of mentor in your team, but you should add others. Perhaps you can also do work with a postdoc or coauthor who would provide the togetherness/teamwork you are looking for. You might also want to add a junior person with a different research specialty but a great personal connection to you who can provide some career-focused advice rather than research-focused advice. And others as needed.

Personally, my advisor was like yours. I cultivated other relationships with more junior people to supplement his more 10,000-foot approach. It was good training for being an independent researcher.