How do private investigators track cell phones

How do private investigators actually track phones? Is it legal or do they use some gray-area methods?