what is rooting a phone

Is it like jail breaking is it dangerous