The concept of using bonds as a hedge against stock market declines is based on observations during periods where interest rates are relatively stable. A common theory is that when the market turns against stocks, the money from that sell off will be used to buy bonds, increasing the demand for bonds. In addition, it's often the case that market downturns come during periods of low growth and therefore lower interest rates. Lower interest rates on new bonds issuances increase the value of older issuances of bonds that pay higher interest rates.
Recent events, however, do not fit into that model. The extremely low interest rates for debt that were in place since the great recession resulted in a lot of money going into the stock market and increasing valuations. Bonds were unappealing due to the very low rate of return.
When the fed increased rates drastically it took some of the wind out of the sails of the stock market. It also crushed the value of existing bonds. The former should be fairly intuitive: less 'cheap' money for people to put into stocks. The latter is simply related to the fact that new bonds are being issued at higher rates so the existing bonds price must fall in order to produce an equivalent yield. That is, loosely, if you have a bond that yields 1% and a new bond with equivalent risk pays 5%, no one will pay you face value for that 1% bond. It will be discounted to the point that it yields 5%.
Will the historical relationship between the stock market and the bond market revert back to the previous trend? That's a matter of much speculation. It might if interest rates (and inflation) stabilize. There are also a lot more types of investments than in the past, so the expected flow of money from stocks into bonds when the market is down may not be as clear-cut in the future. For example, the private credit market which is an alternative to publicly traded corporate bonds has grown immensely.
The above is a story based on theory and interpretations of data. As with any investment theory, you should be careful about believing a story too much. In particular, try to understand the assumptions that investment theories are based on so that you can reevaluate if those assumptions do not hold.