I think there’s a fundamental human drive to regret - evolutionarily, it makes sense that we’d be optimized to know exactly how we would do better in a bad situation we recently faced.
But in the modern world, this isn’t a matter or life or death, and it affects our mental health significantly. I always think of Stoicism as a sort of patch to override this bug - the you can’t change what you can’t change, whatever happens, happens.