In the USA, under the DCMA, it’s legal to root your smartphone. However, rooting a tablet is illegal. This exemption grant came around 2012. In 2016, the overall picture is still unclear.
Jailbreaking a phone and “rooting” the phone are not exactly the same thing, however to the common smartphone user who wishes to accomplish either is typically only looking for the ability to load software, skins and make modifications to the phone without restriction.
jailbreaking is so widespread is because it lets you truly customize your phone. By default, the iPhone’s app icons, taskbar, clock, lock screen, widgets, settings, etc. aren’t configured in a way to let you change the colors, text, and theme, but jailbroken devices can install custom skins and other tools.
Also, jailbroken devices can be set up to let you remove apps that you can’t normally delete. For example, on some versions of the iPhone, you can’t remove the Mail, Notes or Weather app, but hacking tools lets you lift that restriction and truly remove those unwanted programs.
Rooting a smartphone means that you have root access on the device. Root is the super user account name on UNIX and Linux operating systems. In order to achieve root access on an Android device per say, there needs to be a vulnerability that can be exploited and achieve privilege escalation just like you would if you had a user account on a Red Hat linux machine. There have been vulnerabilities so far in every release of the Android operating system and this trend will most likely continue for sometime. Once you have root on your Android device the sky really is the limit, you have full access to install or delete anything you wish so BE CAREFUL!