Averaging stock market capitalization to GDP ratios from seventeen developed economies over the past 150 years reveals the world has never witnessed an equity bubble of the current magnitude. The weighted average of seventeen stock market cap to GDP ratios reached 162% at the end of the third quarter of 2021, which is the highest ever since 1870. It’s unlikely it has been higher previous to 1870, because economies were not as intertwined then. Most likely, equity bubbles were more local. In addition, before 1870 countries were commonly on a metallic standard that prevented long periods of excessive speculation.
Looking at absolute valuations is a problematic affair: the real interest rate has declined for 500 years (https://www.bankofengland.co.uk/-/media/boe/files/working-paper/2020/eight-centuries-of-global-real-interest-rates-r-g-and-the-suprasecular-decline-1311-2018). When real yields decline stock valuations should go up. So looking at them vs gdp without adjust for interest rates does not work well.
Look at it this way: people have for hundreds of years accumulated financial wealth. This has particularly been the case since the 80s as the tax regime fundamentally changed in favor of companies and wealthy people. The wealthy don't hold much wealth in cash (say around 10% of their financial wealth) - they hold stocks and bonds instead.
As they accumulate more and more money due to income concentration they need to buy more assets. If the economy can't provide enough investment opportunity asset valuations will increase - which is another way of saying yields will decline.
You can look at relative valuations or at valuations relative to real interest rates. But spending too much time on absolute valuations just makes you miss out and generally feel miserable.