Know which way the wind blows
To understand what is happening in changing circumstances and to be able to anticipate the future.
The weather or windward side is the side from which the wind blows. For sailors, huntsmen and farmers knowing where the windward was at any time was obviously important, and it isn't difficult to see why 'knowing which way the wind blows' came to be synonymous with skill and understanding.
The figurative sense of 'the way the wind blows', i.e. meaning the tide of opinion, was in use by the early 19th century. In November 1819, The Times published an advert for a forthcoming book - The Political House that Jack Built, which was said to be "A straw - thrown up to show which way the wind blows".
Bob Dylan's Subterranean Homesick Blues, 1965, encouraged the young to make their own decisions with the lines:
You don't need a weather man
To know which way the wind blows