Cost of subaru engine rebuild

I realize that this type of engine failure happens . . . and it confirms my desire to do my own maintnenace and drive sensibly when I see someone put out 5k for a rebuilt engine. I’m curious as to what caused the failure on such a relatively new car. Oil . . . filters . . coolant . . are relatively cheap when compared to this. My two cents is that this price is about right when you consider the guarantee. Get it in writing. Good luck with your new engine! Rocketman