We walked barefoot on the beach. Here, "barefoot" is an adverb telling only how we walked.
We walked on the beach in bare feet. Here, the prepositional phrase "in bare feet" is also adverbial in function, but modifies the entire clause, "we walked on the beach." The preposition "in" shows the relation between the "mode" in which we appeared and the action we performed.