The bèi structure in Chinese is similar to the passive voice in English. However, English passive voice sentences are commonly rendered in Chinese as topic-comment sentences.
cài chī wán le 。
The food has been eaten.
jiāo shì dǎ sǎo gàn jìng le 。
The classroom has been swept clean.
The bèi structure comes into play (1) when an ‘agent’ is introduced into the sentence or (2) the speaker adopts a narrative stance and describes how something has happened:
(1) bèi with an agent:
cài bèi wǒ chī wán le 。
The food was finished by me.
jiāo shì bèi xué shēng men dǎ sǎo gàn jìng le 。
The classroom was swept clean by the students.
(2) bèi in a narrative sentence:
cài bèi chī wán le 。
The food was eaten (by someone).
jiāo shì bèi dǎ sǎo gàn jìng le 。
The classroom was swept clean (by someone).
In the sentence “菜吃完了。cài chī wán le。”, the speaker takes a commentative stance, observing that the food has been finished and there is none left. By contrast, in the sentence “菜被吃完了。cài bèi chī wán le 。”, the speaker adopts a narrative stance, and is saying what has happened to the food, i.e. it has been eaten by somebody.
 Yip, P. C., Rimmington, D., Xiaoming, Z., & Henson, R. (2009). Basic Chinese: a grammar and workbook. Taylor & Francis.