Okay, so there are several reasons. The primary one is simply that the First-Past-The-Post voting system heavily favors a two party system because it encourages tactical voting. The Liberals benefitted from being one of the two parties for many years and then they didn't.
So, another big reason that the Liberals did so badly is historical and has its roots dating back to their last election victory. The Liberal Party at that time encompassed two camps of about equal strength. There were the Old Liberals, led by Asquith, who were traditional Gladstonian classical liberals. Their political tradition dated all the way back to the very founding of the Liberal Party. They largely opposed government intervention and the like. On the other side were the New Liberals, most well personified by Lloyd George and Churchill, who supported a robust welfare state, not dissimilar to the one that the Germans had at the time. Now, part of that was out of their own idealism that Britain simply couldn't carry on being a nation where, as Churchill said, "the vanguard enjoys the delights of the ages while the rearguard struggles in conditions crueller than barbarism", and part of it was pragmatic as the Labour Party had just begun rising and stealing votes from the Liberals' left.
Fast forward a bit to the election of 1918, otherwise known as the "Coupon Election". During WWI, Britain had had a coalition government of Liberals, Tories, and Labour (who had withdrawn from the coalition by the time of the election, but a few did remain and two got the famous coupon (John R. Bell and James Parker. Parker won). When the election was called, Lloyd George and Bonar Law issued a short "coupon" letter endorsing specific candidates in each constituency. Trouble was that the number of Tory endorsed candidates far outnumbered the Liberal endorsed ones and a number of Independent Liberals under the leadership of Asquith fought the election. When the results were in, the Liberal PM Lloyd George ended up leading a government mostly made up of Tories and the Liberal Party ended up as two separate political parties. They fought the 1922 election as two different parties, finishing third and fourth while Labour climbed into official opposition. Finally in 1924, after the first Labour government, many anti-socialist Liberals switched their affiliation to the Tories (since the Liberals had helped to prop up the first Labour government). The Liberals were chronically short of funds from that point on and could no longer stand in every constituency as the unions increasingly supported Labour while business increasingly supported the Tories.
The Liberals did make a small scale comeback in the general elections of 1974. They were competitive in terms of the popular vote thanks to the affable personality of their leader Jeremy Thorpe (who later had one of the worst scandals of 20th century British politics. Seriously, look that one up) and the general unpopularity of both Harold Wilson and Ted Heath. Their comeback in the 80s reflected a similar dynamic with some assistance from the Breakaway SDP (although many Liberals that dealt with David Owen when he became leader of the SDP would say he was more of a hinderance since he seemed to loathe most of the Liberals with the exceptions of his fellow West Countrymen John Pardoe and David Penhaligon). Thatcher, pre-Falklands War, was very unpopular. The economy was in rough shape and her government was regarded by many as cruel. On the other side, Labour was going through a tumult similar to what it went through during the Corbyn years. Michael Foot, devoted parliamentarian with years of government experience (unlike Corbyn) came across like he was senile or demented. He gave rambling interviews and often made confusing policy statements in debates. The media made fun of him because he was also kind of sloppy (the infamous Donkey Jacket incident stands out). I mean today, it sounds absurd, but David Steel really did have cause to tell the Liberal conference, "Go back to your constituencies and prepare for government". It's just the Falklands War happened and ultimately the SDP-Liberal Alliance's dual leader campaign ended up confusing voters. If Labour had done just a tad worse, the Alliance would've outmatched their popular vote total (and probably picked up a few more seats) and they would've had a strong case to make going into the next election that they really were the true opposition party, they just needed a voting system that would bear that out.
So, a quick summary: Party split, lack of funds, Tactical voting from former supporters on both the left and the right squeezed them.
Numerous sources contributed to this answer and I could probably cite them individually if necessary.