Consider this pair:
(1) John ate an apple.
(2) An apple was eaten (by John).
In (1), the voice is active. Active voices in English have the argument structure of {Agent, V+Theme/patient etc.}. So, in (1) the agent is John. It has an agent theta role, or External Theta role (his role is the agent, eater of the apple). It is also case marked by the finite I (tensed clause): [IP John [I {past} [VP t [V eat DP an apple]]]]. So, the specifier of IP is the position where nominative case is assigned in English. John has nominative case, because its structural position is Spec,IP. Quite the opposite is the object. Its theta role is something which is eaten, a receiver of the action performed by John. Its case is accusative. This case is assigned to it by the verb. Now, this is the picture in the active voice.
Whilst transforming active into passive voice, two properties are observed:
1'. The passive verb (now eat in (1) will be passivized) in (2) does not assign Accusative case. You can observe this because an apple which was assigned accusative in (1) had to move in (2). Its passivized verb does not assign case. It should look for another alternative. NPs (John, man, apple) must have case to survive in a sentence.
2'. The passive verb in (2) does not assign the agent theta role to its Pre-position. You can observe this in (2) where no agent appears before the verb. Still, English passives recover the agent with an optional by phrase.In generative syntax, these properties are attributed to the passive affix en.
Now, let us examine these properties in the passive construction, the first step is the following:
a. [IP nominative [I {was} [VP V eat+{en} DP apple]]
Since V passivized with en cannot assign case, the DP apple has to move to an upper position to be licensed (remember that case licenses NPs). Also, the passivized verb with en absorbs the agent theta role (external theta role). Normally this theta role is received by the logical subject of the sentence (i.e., John), but look at the passive sentence in (2) the agent does not appear in a pre-verbal position as it does in (1). Moreover, we can get rid of this agent all the same (e.g., An apple was eaten). Since en absorbed both accusative case and external theta role, the position in the specifier of IP remains empty. This is why the NP apple moves there and the result is the nominative Case assigned to it by I. The result is the following:
b. [IP An apple [I {was} [VP V eat+{en} DP t]]
This case absorption is more obvious with pronouns:
(3) He{nominative} kissed her{accusative}
(4) She{nominative} was kissed (by him{accusative})
The object pronoun her in the active voice in (3) is assigned accusative case (objective case). When the verb is passivized (with en, in this case ed), it absorbs this case and makes available the specifier position in IP by absorbing the external theta role of the sentence. This is why her can move there and be realised as She.
This process is subsumed under a more general principle called Visibility on Chains. But I'll not go deeper here. I hope I made it a bit clear.