I've had this question for a little while and I asked a professional about it today, but I don't think I worded it well. As such, I didn't get a good answer.
Theoretically, given an equivalent amount of money, why would I put my money into a 401k or IRA instead of another investment vehicle?
From what I understand, capital gains are not taxed unless they are realized. (I understand that dividends may be different, even if reinvested, although I'm not quite sure.) The major benefit of a traditional 401k or IRA is the way the taxes are handled; you are not taxed on contributions you make until you begin pulling from the account.
I'm not sure how this is different than a non-retirement account. Couldn't you invest for long-term capital gains (as many retirement plans do) and achieve a similar result by realizing the gains later on and being taxed on those? Or is it the contributions that are the key here?
Additionally, since retirement accounts have a contribution limit (year 2015 in the US, where I live, it's $18,000 and $5,500 for the 401k and the IRA, respectively), wouldn't investing without the retirement account let you contribute more if you were capable of doing so?
I want to note that I'm asking this for knowledge purposes. (Knowledge is power, and this stuff is cool!) I do currently enjoy a 401k and Roth IRA and I don't intend to give them up soon. I suppose the real area of knowledge I'm looking for is how different kinds of investments are taxed.