In those days there was no king in Israel. Also in those days the tribe of Dan was searching for a territory of their own to live in, since no permanent territory had been assigned to them among the tribes of Israel up to that point.
References for Judges 18:1
The Danites sent five men from their whole clan, strong men from Zorah and Eshtaol, to spy on the land and explore it. They told them, "Go explore the land." So they went into the Ephraim highland as far as Micah's house, and they spent the night there.
When they were in the area of Micah's house, they recognized the accent of the young Levite. They turned in there and said to him, "Who brought you here? What are you doing in these parts? What is there for you here?"
"Micah has done a lot for me," he replied to them. "He hired me to be his personal priest."
They said to him, "Ask for an answer from God so we can know whether we'll be successful on this trip we've taken."
The priest replied to them, "Go in peace. The LORD is watching over you on this trip you've taken."