They are similar, but there are some important distinctions. Both will allow you to take existing loans and create a new loan. Federal student loan consolidation brings multiple federal student loans together with a Federal Direct Consolidation Loan (in some special circumstances, you can consolidate one federal student loan by itself). On the other hand, refinancing allows you to combine different types of student loans together (federal, private, etc.), or it may be done with just one loan.
When it comes to choosing between refinancing and consolidation, you never have to pick one or the other. You can choose to consolidate some or all of your federal student loans through the Direct Consolidation Loan Program (especially if you are trying to qualify for loan forgiveness), and refinance others. The choice is yours.
Private Student Loan Refinance or Consolidation
Refinancing can include both federal and private loans together, is done with a private lender, and requires a credit check, including a debt-to-income analysis. Terms and underwriting criteria will vary between lenders, and your interest rate will be based on your credit, among other factors. Applying with a creditworthy cosigner (such as a spouse) may help you qualify or help lower your interest rate.
Federal Direct Consolidation Loan Program
Federal student loan consolidation enables you to combine all of your federal student loans into a Federal Direct Consolidation Loan. This new loan replaces all of the loans you combined, with one new loan (meaning fewer monthly payments to keep track of). This program may not help you lower your interest rate (since your new interest rate will be the weighted average of the loans you are consolidated, rounded up to the nearest one-eighth of a percent), and will require a check to see if you had adverse credit as defined by the U.S. Department of Education. In most cases you are required to consolidate at least two loans. The lender in this case will remain the U.S. Department of Education and your Direct Consolidation Loan will be serviced by a federal student loan servicer.
With the federal program, you will not be able to include any private student loan debt, or any debt for which you are not the borrower (e.g., a Federal Parent PLUS loan borrowed by your parent).