There are several moving parts here that need consideration. Merrick is the only one with election timing but there's a long history here running up to him.
Democrats blocked Robert Bork
The reason we have a Kennedy retirement now is that Robert Bork (Reagan's first pick in 1987) was blocked by Democrats. While some point to his role in Nixon's firing of a special prosecutor during Watergate (Bork would appoint another to replace him), many considered the block to be on partisan grounds, especially considering the fiery speech given by Ted Kennedy on the Senate floor
Robert Bork's America is a land in which women would be forced into back-alley abortions, blacks would sit at segregated lunch counters, rogue police could break down citizens' doors in midnight raids, schoolchildren could not be taught about evolution, writers and artists could be censored at the whim of the Government, and the doors of the Federal courts would be shut on the fingers of millions of citizens for whom the judiciary is—and is often the only—protector of the individual rights that are the heart of our democracy ... President Reagan is still our president. But he should not be able to reach out from the muck of Irangate, reach into the muck of Watergate and impose his reactionary vision of the Constitution on the Supreme Court and the next generation of Americans. No justice would be better than this injustice.
Democrats rail against Clarence Thomas
Clarence Thomas would face even more dire circumstances than Bork. After a leak of an FBI inquiry, Anita Hill, a former colleague of Thomas, testified dramatically in front of the Senate that Thomas had sexually harassed her. Without any corroboration, many Senators did not believe her. Thomas won confirmation narrowly, 52-48
Joe Biden's 1992 speech, demanding no more nominations be made by Bush(41) until after the election
This speech, made after the contentious Thomas hearings, called for no more nominations in an election year. This is why many refer to the policy as the "Biden rule". Biden would not get a chance to use it, as Bush lost reelection to Bill Clinton and no more nominations would be made that year.
Democrats had filibustered Bush(43) appellate nominees
Democrats found themselves out of power from 2002-2006 and so they began to filibuster appellate nominees, most notably Miguel Estrada, who was filibustered for 6 months, and languished for 28 months in total. Wikipedia notes
Numerous judicial nominees prior to Estrada had been kept off the courts, when the Senate refused to let the nomination out of committee for a floor vote. A filibuster had been used in 1968 to extend debate regarding the elevation of Associate Justice Abe Fortas to Chief Justice of the United States, but the Estrada filibuster was different in multiple ways. Estrada's was the first filibuster ever to be successfully used against a judicial nominee who had clear support of the majority in the Senate. Estrada's was the first filibuster of any court of appeals nominee. It was also the first filibuster that prevented a judicial nominee from joining a court.
Democrats engaged in a symbolic filibuster of Samuel Alito (2007)
Samuel Alito, whose nomination was quite contentious, faced a symbolic filibuster. The filibuster failed 72-25, but included many notable Democrats, including then-Senator Barak Obama.
Charles Schumer vowed to filibuster any further Bush(43) SCOTUS nominees
This video came back to haunt Schumer
Democrats went nuclear to stack the DC Circuit
In 2013, facing several challenges to Obamacare winding their way through the courts, Senate Majority leader Harry Reid and President Obama put forth three nominees to fill the three vacancies on the circuit (the least busy court on the appellate level). Republicans, using the same tactic Democrats had employed, filibustered all three. Harry Reid then invoked the so-called Nuclear Option, removing filibusters for cabinet and judicial nominees below the Supreme Court level.
The three vacancies were confirmed without further incident, although Carl Levin, a retiring Democrat, railed against it, warning that Democrats would come to regret it.
The Merrick Garland nomination would have significantly changed the SCOTUS ideological makeup
Obama thought he could pull a "small shift" but even reports that painted him as a moderate had to admit it was still quite a shift
It wasn't surprising that a still-fresh Republican majority blocked him.