Tax-free account is where you can put your pre-tax money into it and grow/invest overtime without paying tax on the gain. When you retire or older than 59.5 year old, you can withdraw the invested money plus the capital gain without any tax concern. You then can invest those money into the a Treasury bills (T-bills) with the interest rate (between discount and face value) about 4-6% (higher than inflation rate) and have a nice lifestyle retirement. T-bills will pay interest rate every six month, you have to pay tax on this interest but it is lower than your income tax when you was working. T-bills is not a compounding investment.
Tax-deferred accounts is for you to put money to invest and defer all the taxes on original investment and capital gains until you retire and withdraw money out of this account. You have to pay tax eventually but that is when you retire and the tax bracket for retirement is lower when you was working.
Both accounts are for your retirement, not speculation, so you will end-up with a high penalties if you have an early withdraw (except special case such as for your first home buying, higher education tuition fee for you, your spouse, your grandchild, etc).
In the US the tax from your investment gain is often lower than your day-job income tax, the theory behind it is investment brings jobs so it is expected to have lightly tax than your work. There is only one type tax–free retirement account: the Roth IRAs and Roth 401(k) plans.