Here are some outstanding lines from the Ashtavakra Gita:
He who has known that adversity and prosperity come through the effects of past actions is ever contented.
Notice how it says both adversity and prosperity. Not only prosperity. It’s not only the good experiences and things we have which lead to contentment. Instead, it is the knowledge that both adversity and prosperity come from past karma – that’s what leads to true satisfaction. If something bad happens, it probably resulted from something much more than just what we did an hour ago. If something great happens, it too probably resulted from something more than just last hour’s effort. We must think not just about the outcome, but of the million billion incidents that had to all happen since we were born, in order to bring that specific event to fruition.
He who knows that happiness and misery, birth and death are also due to the effects of past actions becomes free from care and is not attached even though engaged in action.