What is the actual cause of this error ? I know how to solve so dont need that but just want to know why that error occur. If we run it on root what can be the problems faced ? Also What to do if we want to run Tor Safely ? like without making changes in code.
The message itself comes from the start script. It checks if the current user has the id 0 (which is the root user) and exits with the message:
The Tor Browser Bundle should not be run as root. Exiting.
In general it is considered good security practise that one should not run software as root. Especially when one browses the web there are quite some possible attacks and browsers have lots of weaknesses. So if it is possible for a website to successful attack the browser, it can access local data. In the case of a root user this means that the attacker has access to the whole system. The attacker can read and write arbitrary files.
So for security reasons it is better to run software as a normal user.
But also when you think about normal operation it is quite dangerous to do everything as root. Usually people make mistakes and making a mistake as root can have catastrophic outcomes. So it is better to only make administrative work as root and everything else as normal user.