Actually, not always demo win and real lose, but on average, that's how beginners feel.
the reason is simple, because demo trading is not real money, it means there is no mental pressure, besides that the demo account capital is quite large.
even though you have learned a lot in a demo account, when you enter a real account you will definitely feel the loss first because you don't have a mental feeling.