V2 Technologies interview question

Why dependency array is important for useEffect