The adjective in this case is a kind of predicative complement (complemento predicativo). It does double duty as an adverbial complement to the verb and as a qualifier to the noun. It is optional: you can remove it and the sentence will still be grammatical. When present, it will agree with the noun (or noun phrase) it modifies, which doesn't have to be the subject.
- Modifying the subject:
- Él duerme desnudo. = "He sleeps naked."
- Los niños volvieron cansados. = "The children came back tired."
- Modifying the direct object:
- Vendimos muy barato el auto. = "We sold the car very cheap."
- Encontré tirada una billetera. = "I found a wallet [that had been] dropped [on the floor]."
- Modifying the indirect object:
- Se aprovecharon de ella dormida. = "They took advantage of her [while she was] asleep."
Note that in the English translations there are some instances where I had to insert the verb "be". This is a clue to what's happening in there. In fact a linking verb could be inserted (if clumsily) into all of the translations. Implicitly the verb argument is being predicated on by "be", "become", or "appear".
I'm trying to think of verbs that allow or disallow these complements but I'm not finding anything. If the verb allows adverbs as complements it will allow these predicative complements.