What happens to laws that don't pass by the end of the legislature? 

All plenary votes taken by the Parliament ahead of European elections remain legally valid into the following legislature. This means that following elections, incoming MEPs pick up files where they were and take them to the next stage in the decision-making process.

For legislation that does not reach the plenary level before elections, there is no legally valid Parliamentary position.

Therefore, Parliament's internal Rules of Procedure stipulate that the work done on them (e.g. in committee) lapses. However, at the beginning of a new parliamentary term, the Conference of Presidents – the President and political group leaders – may decide to continue the work already carried out on those files (Rule 240 of the Rules of Procedure).