When the people of Dan lost their land, they went to Laish and attacked it. They captured it, killed its people, and claimed it for themselves. They settled there and changed the name of the city from Laish to Dan, naming it after their ancestor Dan. 1
References for Joshua 19:47
19.47 Jg 18.27-29.