/u/Woodstovia has a good comment on why Reagan won such a lopsided victory in 1984. Essentially, Mondale was running on raising taxes (including on the middle class) to cut the deficit and had an unpopular foreign policy. Reagan, by contrast, was happy to allow the deficit to bloom and had sanded off the rough edges of his foreign policy. But the section that is most germane to your question is the following:
Reagan also underwent a process criticized as "blandification" where he somewhat distanced himself from his party and presented himself as a national figure of peace and unity, who wanted every day to be the 4th of July and brought Morning Again to America. Notably whilst Reagan won a landslide the Republicans lost 2 seats in the Senate and an 18 seat gain in the house still meant there were 253 Democrats to 182 Republicans
Looking at the percentages of the popular vote in the two elections is even more instructive.
The Senate and House elections popular votes were 'won' by the Democrats, respectively, 49.8% to 49.3% and 52.1% to 47%.
In the 1986 election, the Senate and House elections popular votes were 'won' by the Democrats, respectively, 50.1% to 47.6% and 54.3% to 44.4%.
So, especially given the principle that the party controlling the presidency generally loses seats in a midterm election there's not really much of a mystery to explain. The Dem Senate vote edged up less than half a percentage point and the House vote edged up about two percentage points.
Edit: /u/poshmahogany raised concerns with national popular vote totals for Senate elections. House elections are certainly better to do an apples-to-apples comparison between two elections than the Senate (as 100% of House seats are up but only ~33% of Senate seats). The Senate is divided into 3 classes and in any election only one class is 'up': 1984 was a class 2 election and 1986 was a class 3 election. The following states are in both class 2 and class 3: Alabama, Alaska, Arkansas, Colorado, Georgia, Idaho, Illinois, Iowa, Kansas, Kentucky, Louisiana, New Hampshire, North Carolina, Oklahoma, Oregon, South Carolina and South Dakota.
We can calculate the Senate popular vote in these class 2/3 states. In 1984, there were 21,076,713 total votes of which 10,356,468 went to the Democrats and 10,513,854 went to the Republicans. In 1986, there were 16,447,373 total votes of which 8,564,662 went to the Democrats and 7,790,534 went to the Republicans (careful readers will note that the Democratic plus Republican vote does not add up to the total; that is because there were various third parties running)..
As such, in 1984 the Democrats 'lost' the popular vote in the class 2/3 states by 49.1% to 49.9% but 'won' the popular vote in 1986 52.1% to 47.4%. So you see a slightly greater swing than the house, but still less than 3 percentage points. Of course, the comparison is not perfect as there are different Senators up for election, incumbency bias etc. but it is a closer apples-to-apples comparison of those two years.