On commercial flights, an announcement will be made if turbulence is expected ahead and if the route will be adjusted such as moving to a higher altitude.
How do pilots know that turbulence is ahead in time to make an announcement and an adjustment? Is it weather equipment in the plane or the ground? Is it because they follow common routes and listen to reports from planes ahead? Are they notified from the ground? Is there some other way they know in time to prepare their passengers?