I wouldn't say just happen, but has been in the making for a long time and finally fell through. Federal judges are nominated by the President and confirmed by the Senate. During Obama's second term, McConnell being the Senate majority leader stopped confirming judges via obstruction. He took a gamble on the Senate remaining GOP controlled, and the White House being filled by a Republican as well. So he rode it out Obama's last term. Changing the judiciary landscape has been a dream of conservatives for years (See the Federalist Society) and the stars finally aligned. This is a gravy train for them so long as the Senate and White House remain Republican.