For example, the active-voice sentence
The boy threw the ball.
might be rephrased in passive-voice as
The ball was thrown by the boy.
Here the grammatical subject is the ball, but it’s the thing acted on by the verb. The passive voice can be used to avoid having to state who or what performed the action by omitting by the boy altogether:
The ball was thrown.
or colloquially as:
The ball got thrown.
The passive voice is often used simply to take emphasis away from the agent of the action. For example, in this paragraph, the passive voice is used to avoid putting focus on the speaker or the author. (Italics are used here to point it out.) It is often used by speakers to avoid responsibility for the action they describe; for example, an apology might say “Mistakes were made” instead of saying “I made mistakes.”
Because of this use, the passive voice has a bad reputation, and many usage experts recommend avoiding it where possible, but in certain kinds of formal language the passive voice is expected and required.