How do emotions change?

if you are feeling sad and then someone gives you money your emotions can change from sad to happy so emotions change from pride