I am a researcher of the market and to answer your question you need to look at the data in a way that doesn't really seem to be presented here. The issue isn't gains or losses, but gains or losses relative to other opportunities. Imagine that I am 20 and invest $100,000 and at age 80 I have $100,000.01. I made a gain. That is the wrong discussion.
Let us start with a really poor outcome. Had you invested in the Dow Jones Industrial Average on January 1, 1929 and you had a fried invest in short-term Treasuries at the same time, you would not catch up to your friend until 1963 in total return, ignoring taxes and commissions. It could have been longer or shorter if the bond holder could have used certificates of deposit in lieu of bonds and if the holder of the Dow had minimal commissions, although they were regulated at the time and quite high.
Long cycles like this happen more often than people realize. I also ignored long-term bonds, real estate, non-precious metals, comic book, art and owning your own business.
The reason to buy stocks is that the dividends, but not the principal, are a good hedge against inflation. They tend to rise at the lagged inflation rate. The principal, however, is fickle. Bankruptcies and mergers become common over long periods of time in the sense that only one member of the original Dow still exists. However, of the remaining nineteen members only one went under and truly lost everything. The rest were either bought out at premiums or tetered on bankruptcy and were bought out at discounts. You would be very wealthy right now if you had purchased the original set of twenty stocks in that first list. You would not have as much money as the current average would imply, but you would have done quite well for yourself.
The reason to hold bonds is to protect yourself from bad times. Bonds are most valuable when things start falling apart. You especially want to hold bonds today if there is blood running in the street tomorrow. When people fly to safety they will pay huge premiums to protect their wealth by putting in bonds. Conversely, stocks are least valuable when you need them to be valuable and most valuable when they are not needed. Stocks are pro-cyclical and bonds are counter-cyclical. Bonds have poor inflation properties unless you happen to purchase them near the peak of an inflationary period, then the decision to buy will have been the best idea any human could have made. Of course nobody knows that peak, so you will be out of luck being that person.
The optimal investment tool is to use the Kelly Criterion. Unfortunately, the limitations of this forum in terms of mathematical notation limit the statement's helpfulness. If you have calculus then you can do the work for yourself. The Kelly Criterion will generate the greatest geometric profit of all gambling methods, regardless of what you are gambling on.
It was developed during the Cold War because the President launching nuclear weapons based on an electronically noisy signal which could be false is a devil of a gamble. There were several near launches during the Cold War that could have ended all life on Earth. The Kelly Criterion works independent of what you bet on.
Roughly, though, it protects you from gambling either too much or too little. In periods of low prices you will tend to hold more concentrated positions and in periods of high prices, like today, you will tend to hold many very small positions. If you have the calculus skills then you can make adjustments to the Criterion for life's constraints such as paying for a mortgage or a child's education. A person with a mortgage should carry smaller positions than the normal criterion suggests to assure payments on a mortgage even in times of crisis. Likewise, as the date of a college education approaches, then more bonds should be held.
If your long run concern is an income, then you should be buying stocks. If your long run concern is availability of emergency cash, then you should buy bonds. If you are going to be purely passive, then you should decide how to balance these constraints. You should also consider the relative value propositions of other potential assets, such as real estate, which I didn't really touch because its dynamics would take a long time. We have had forty years of falling inflation and that makes real estate very valuable, but we have also had large demographic and geographic shifts that need accounted for. It is a more complex discussion than your question seeks an answer for.
A final piece of advice. I had a colleague without much knowledge of the capital markets and she was invested entirely in stocks and was twenty-five. She had a terrible time opening her monthly statements because if it was down from the prior month it really shook her up. I asked her why she opened them. After all, if she isn't going to change her behavior, then the content of the statement doesn't matter. I recommended she look at them as one bunch to make sure the statements had proper crediting of contributions, but otherwise to not look at them. There I no need really if it will not alter your behavior.
If you are going to be a passive investor, read the statements as a way to verify compliance with the terms of the broker's agreement and matching up cash flows. Otherwise, it doesn't matter what they say. Make you plan and stick to it, for the next sixty years.