By-elections also spelled bye-election (known as special elections in the United States, and bypolls in India) are used to fill elected offices that have become vacant between general elections. 

In most cases these elections occur after the incumbent dies or resigns, but they also occur when the incumbent becomes ineligible to continue in office (because of a recall, ennoblement, criminal conviction, or failure to maintain a minimum attendance). Less commonly, these elections have been called when a constituency election is invalidated by voting irregularities. 

In the United States, these contests have been called "special elections" because they do not always occur on Election Day like regular congressional elections. A 2016 study of special elections to the United States House of Representatives found "that while candidate characteristics affect special election outcomes, presidential approval is predictive of special election outcomes as well. Furthermore, we find that the effect of presidential approval on special election outcomes has increased in magnitude from 1995 to 2014, with the 2002 midterm representing an important juncture in the nationalization of special elections." 

The procedure for filling a vacant seat in the House of Commons of England was developed during the Reformation Parliament of the 16th century by Thomas Cromwell; previously a seat had remained empty upon the death of a member. Cromwell devised a new election that would be called by the king at a time of the king's choosing. This made it a simple matter to ensure the seat rewarded an ally of the crown.
How do you know?  What was done?
Furthermore, we find that the effect of presidential approval on special election outcomes has increased in magnitude from 1995 to 2014