What makes it possible for Bilbo to avoid capture when the Wood-elves take the dwarves prisoner in The Hobbit?

He hides in a tree in the forest, so the Wood-elves do not see him.

He climbs into an empty wine barrel, which the Wood-elves do not search.

He disguises himself as a guard, and the Wood-elves do not recognize him.

He wears the ring, which makes him invisible.