1. To criticize and offer advice, with the benefit of hindsight.
2. To foresee the actions of others, before they have come to a decision themselves.
A commonly used meaning of 'to second-guess' is to criticize the actions of others, after the event. The event in questions was, and often still is, a sporting event. The term is derived as what is known as a back-formation. As back-formations loom large in etymology I'll break off to explain what they are.
New words are usually created from existing words. For example, we all know what 'fishing' means and, armed with that knowledge we could easily coin the word 'fisherman' and a phrase like 'fishing for compliments'. Sometimes though, the order that words and phrases are derived in isn't so obvious. For example, people who rob from houses have been called 'burglars' since the 13th century and it might be supposed that they got their name from being engaged in 'burglary'. However, it wasn't until the 19th century that the legal profession decided that 'that thing that burglars do' needed to be given a name and hence 'burglary' was coined as a back-formation from 'burglar'. Likewise, 'narration' and 'scavenge', which were coined centuries after 'narrator' and 'scavenger'.
The same back route was taken by the phrase 'second-guess'. The umpire in a baseball game used to be called, rather unkindly, 'the guesser'. People who were continually telling the guesser, the manager or the players what they were doing wrong were known as 'secondguessers' and were so defined in the Sporting News Record Book, 1937:
Secondguesser, one who is continually criticizing moves of players and manager.
Another meaning of 'to second-guess' is to anticipate what others might do in a particular situation. This is also of American origin but, somewhat more impressively, refers to a guess made before rather than after the event. An early example of its use comes from Broadcasting magazine, December 1941:
Do not try to second-guess or master-mind our military officials. Leave this for established military analysts and experts, who are experienced enough to await the facts before drawing conclusions.