Capital Gains v RSP

So what am I missing here, because no one seems to mention it. If I put $1000 into my rsp, it grows over the next 30 years and becomes say $5000. When I take it out, 100% of the money in there is taxed at whatever tax bracket I fall into in retirement. Let’s say it’s the lowest so I’m taxed at about 20% and end up with $4000.

Where as if I just put that into a normal investment account, I’m taxed on my initial contribution (the income tax) but in 30 years when I take it out, only 50% of the capital gains portion (which by now is the majority of the money I have in there) is taxed. So effectively paying 10% tax on the 4000, so I end up with 4500

Even if I take into account that I’ll have more money to invest now with an rsp contribution because I’ll get the 30 something percent tax back, so now my rsp contribution is 1300 rather than 1000. At best it comes out to about even.

What am I getting wrong here?