Wins Above Replacement
WAR attempts to measure a player's value - expressed in wins - over that which would have been contributed by a fictional "replacement-level player" (essentially a AAA-quality player who can be readily acquired by a team at any time for the league's minimum salary) in the same amount of playing time.
Although Bill James hinted at the idea in his Baseball Abstracts of the 1980s, the roots of today's WAR can be more directly traced back to Keith Woolner's concept of VORP (Value Over Replacement Player), which debuted in the 1990s for Baseball Prospectus and was probably the first statistic to measure a player's value in position-adjusted runs above the replacement level. Prospectus would later turn VORP into WARP (Wins Above Replacement Player) using Clay Davenport's fielding runs above average, and even introduced era-adjusted variants like WARP-2 and WARP-3.
Still, WARP failed to gain mainstream traction because it was not widely available, and the formula was proprietary (a proverbial "black box"). That changed in the late 2000s, when Sean Smith of BaseballProjection.com and the site Fangraphs.com introduced their Wins Above Replacement variants using an open-source framework laid out by the prominent Sabermetrician Tom M. Tango.
The framework is simple: start with a player's Runs Above Average in various categories - batting, baserunning, double play avoidance, and fielding (plus a position adjustment) on the position-player side, and runs allowed below the league average (adjusting for park, opponents, leverage, and defense) for pitchers. Then figure out how far, in runs, the average player would have been from the replacement level in the player's playing time, and add that to their RAA. The result is Runs Above Replacement, which can be converted to Wins Above Replacement by using a runs-to-wins conversion factor (usually 10 runs = 1 win).
Smith's WAR became an official part of Baseball-Reference's statistical toolbox in 2009, and was modified in 2012 to account for improved data collection in recent seasons. In 2013, Baseball-Reference and FanGraphs unified the replacement level across their versions of WAR; currently, the only major differences between the two main types of WAR are the defensive metrics used (B-R uses Baseball Info Solutions' Defensive Runs Saved, while FanGraphs uses Ultimate Zone Rating) and the handling of balls in play for pitchers (B-R looks at pitchers' actual RA and credits/debits them based on the defensive quality behind them, while FanGraphs' pitcher WAR is based on FIP).
WAR and the 2012 MVP Race
WAR came to major national prominence late in the 2012 season, when Mike Trout had a major lead in both Baseball-Reference and FanGraphs' WAR despite fellow AL MVP candidate Miguel Cabrera's bid for the Triple Crown. Trout led Cabrera because his hitting was almost equal to Cabrera's after adjusting for park (he wasn't as much of a home run hitter, but had practically the same batting average and walk total - Cabrera's RBI lead was almost totally a function of batting order), his baserunning and double play avoidance was much better than Cabrera's, and he was a vastly superior fielder. Cabrera ultimately won MVP honors, with Trout taking the Rookie of the Year Award, but the intense debate opened the eyes of many fans to the world of all-around statistics beyond batting average, home runs, and runs batted in.