Why do the wood-elves capture and imprison the dwarves?

The Elven-king imprisons the dwarves because he believes them to be trespassing in his kingdom and that they tried to attack his people.