useEffect

What is the primary purpose of the useEffect hook in React?