The dwarves are imprisoned because they will not tell the Elvenking their purpose behind being in the woodland. Bilbo covered up the dwarves in void barrels that the mythical beings cast from the basement hidden entryway and sent down waterway to Lake-town.