A URL is human-readable text that was designed to replace the numbers that computers use to communicate with servers. They also identify the file structure on the given website.
Using hyphens(-) rather than underscores(_) in url makes it much easier for search engine to know about your page. Google treats a hyphen as a word separator but does not treat an underscore that way. If your url is http://www.example.com/on_page_tips then Google treats it same as /onpagetips.
I also suggest you hypen(-) as SE also suggest the same. When we use hypen search engine read it separate word but using underscore makes it single word for SE.