A by-election occurs when a seat in the House of Commons becomes vacant during the lifetime of a Parliament (i.e. between general elections) because the sitting MP dies, resigns, is elevated to the peerage, or becomes ineligible to sit for some other reason. If a vacancy occurs when the House is in session, the Chief Whip of the Party that formerly held the seat moves a Motion for a new writ. This leads to the by-election taking place. Prior notice does not have to be given in the Order Paper of the House. There is no time limit in which a new writ has to be issued, although by convention it is usually done within three months of a seat becoming vacant. There have been times when seats have remained empty for more than six months before a by-election was called. The sitting party will obviously choose a time when they feel confident of success. Seats are often left vacant towards the end of a Parliament to be filled at the General Election though this is not always the case and by-elections have sometimes occurred just before the dissolution of Parliament. While a vacancy exists a member of the same party in a neighbouring constituency handles constituency matters. When the new Member is elected in the by-election, all outstanding matters are handed back. Further information can be obtained from factsheet M7 at the UK Parliament site.
contributed by user local yokel