Tanking in sports refers to the practice of intentionally fielding non-competitive teams to take advantage of league rules that benefit losing teams.  This is a much more common practice in American sports leagues as international sports leagues typically penalize poor performers. International leagues often use what is known as a promotion/relegation system in which the worst teams are relegated and spend the next season in a lower-tiered league. Relegation costs the team revenue and makes it much more difficult to attract top talent, thus making it infeasible to tank. Tanking teams are usually seeking higher picks in the next draft, since league rules generally give the highest draft picks in reverse order to the previous season's worst teams. Tanking may also be referred to as rebuilding. Teams that decide to start tanking often do so by trading away star players in order to reduce payroll and bring in prospects.
Sometimes my job is to understand the value of losing. I know that sounds crazy, but if you're an NBA general manager like me, the last place you want to be is in the middle. There are only two outcomes there: Either make the playoffs and be first-round fodder for one of the premier teams or miss the playoffs and pick somewhere around 11th to 14th in the draft. Either way, the odds are that you stay in that middle range. It's a recipe for disaster.-- Anonymous, 2013
In an interview for ESPN The Magazine before the 2013-14 season, an NBA general manager who chose to remain anonymous (though speculated to be either Rob Hennigan of the Orlando Magic or Ryan McDonough of the Phoenix Suns) stated that because "the last place you want to be is in the middle", his team would try to tank that season to have the best chance at a top pick in the 2014 NBA draft, which was anticipated to be one of the deepest in recent league history. The GM explained how he got the team's owners and the coach to agree to it while trying to keep it a secret from the players.
One of the first teams to "tank" was the 1983-84 Houston Rockets, who considered the season lost after starting 20-26 and decided to play more bench players in order to fall in the standings and get higher in the draft order for the following season. In the 1983-84 NHL season, the Pittsburgh Penguins and New Jersey Devils admitted they wanted to lose in order to get the number one pick in the draft and select Mario Lemieux. But tanking did not become prevalent until the 2010s, when teams in all four major American leagues (the MLB, NFL, NBA, and NHL) were engaged in various forms of the practice.
The Chicago Cubs and Houston Astros pioneered the practice in the MLB in the 2010s, finishing last in their respective leagues for several years. Both teams used subsequent draft picks to select star players who led them to championships, as the Cubs won the 2016 World Series and the Astros won in 2017. Other teams like the Miami Marlins, Baltimore Orioles, Kansas City Royals, and Detroit Tigers have sought to emulate the strategy by trading away top players with the goal of drafting and developing top players and cutting costs in order to become competitive again several years later.
One of the most notable examples of tanking in the modern era of professional sports is from Sam Hinke and the 2013-2016 Philadelphia 76ers. A 3 year struggle from the 76ers culminated in the removal of Hinke from his role as General Manager. In the three seasons from 2013-2016, Philadelphia recorded a total of 47 wins, never surpassing 20 in any year.  However, as the team lost, they collected valuable assets in the form of draft picks.  In the five drafts from 2014-2018, the 76ers drafted six times in the top 10 and selected cornerstones Joel Embiid and Ben Simmons in two of those drafts. From 2017-2020 Philadelphia won more than 40 games in every season and reached the playoffs each year. In the playoffs, however, the team has not fared well, and their performance as of the 2020 season can best be described as "disappointing." 
When Jon Gruden retook control of the Oakland Raiders prior to the 2018 NFL season he liquidated most of the Raiders' talent, most notably trading five-time pro bowler Khalil Mack to the Chicago Bears for two first round draft picks, leading to accusations that he was intentionally tanking the team in hopes of fielding a competitive team when the Raiders move to Las Vegas in 2020. The Raiders, who had finished 12-4 and qualified for the playoffs two seasons prior, finished their 2018 season with only four wins, but saw significant improvement the next season thanks to strong play from the team's rookies.
The Miami Dolphins were widely accused of tanking during their 2019 season when new head coach Brian Flores oversaw a similar liquidation of the team's established talent.  September of 2019 saw two of the Dolphins most talented players sent to contending football teams in exchange for future draft picks.
As the NFL doesn't have a draft lottery, coverage of some NFL drafts has been dominated by the presence of a highly touted player who is widely expected to be among the first picked, portraying them as a prize for the league's worst team. For example, the 2009 NFL Draft was nicknamed "The Matthew Stafford Sweepstakes" as University of Georgia quarterback Matthew Stafford was widely expected to be the first player drafted regardless of which team held the first overall pick. Stafford was indeed drafted first overall, by the Detroit Lions, who did not win a single game during the previous season.
This has led to public campaigns where fans of poor performing teams actively encourage losing in order to improve the team's draft position when such a player is expected to be in the next draft. The first widely known example of such a campaign was "Suck for Luck" during the 2011 NFL season, where fans of mediocre teams encouraged losing in hopes of drafting Andrew Luck, who was considered to be the NFL's best quarterback prospect since Peyton Manning in 1998. The campaign was widely criticized by sports writers, who noted that it isn't in the nature of professional athletes to intentionally lose games and that poor performance should bring punishment, not encouragement.Hall of Fame quarterback Dan Marino denounced the campaign when fans of his former team, the Miami Dolphins, began participating heavily in it and the campaign was also denounced by Luck himself, who called it "stupid". Nonetheless, a similar "Tank for Tua" campaign emerged in the 2019 NFL season, with fans of poor performing teams encouraging losing in hopes of drafting University of Alabama quarterback Tua Tagovailoa. However, when Tagovailoa suffered a season ending hip injury which put his chances of declaring for the 2020 NFL Draft in question, the campaign then turned to LSU quarterback Joe Burrow and Ohio State University defensive end Chase Young, respectively becoming "Bungle for Burrow" and "Choke for Chase".
Similar draft coverage and reaction by fans has been seen in the National Hockey League. Normally, players selected in the NHL Entry Draft continue to play in minor leagues (often their team's affiliate in the developmental American Hockey League) before they reach the NHL, if they reach the NHL at all. Thus, when a draft contains a NHL-ready player who could make an immediate impact for their team, they are coveted. Examples of this include the 1984 NHL Entry Draft, with multiple teams seeking entry into the lottery for the chance to draft Mario Lemieux, or the 2005 NHL Entry Draft, which was nicknamed the "Sidney Crosby Sweepstakes" as it was believed the winner of that year's lottery would immediately draft Sidney Crosby. The 2015 NHL Entry Draft contained two highly-touted prospects, Connor McDavid and Jack Eichel, effectively guaranteeing the last place team would land an elite player, thus fans of mediocre teams encouraged losing throughout the 2014-15 NHL season. This was most prominently seen among Buffalo Sabres fans, who actively cheered for the opposing team at home games while The Buffalo News regularly published the "McEichel Derby," which tracked the Sabres' ranking among the league's worst teams.First Niagara Center infamously erupted in cheers when Sam Gagner of the Phoenix Coyotes scored an overtime-winning goal in a late season match, as the low-ranked Coyotes were seen as a major "threat" to Buffalo landing a top-two pick. The Sabres finished the season with the worst overall record, securing the second-overall pick which they used to draft Eichel. The NHL revised their draft the following season in response, removing the second pick guarantee for the league's worst team and making all 14 teams who miss the playoffs eligible to win a top-three pick through the draft lottery.
The term 'inverse analytics' was first introduced in 2018 when tanking was of utmost importance. The 2018 NBA Draft featured some highly sought after prospects including eventual top picks DeAndre Ayton, Marvin Bagley, Luka Doncic, and Trae Young. In order to contend for the rights to these players, NBA teams allegedly began intentionally losing to the point that an NBA executive reportedly told ESPN that "inverse analytics" were being used. The evidence of this comes from the Dallas Mavericks. Owned by Mark Cuban, the Mavericks used many questionable lineups toward the end of the year.  With less than five minutes to go and down by one point against the Lakers, the Mavericks used a lineup that had played together for a total of 12 minutes during the first three and a half months of the season.  Mark Cuban was even fined $600,000 for openly commenting on the benefits of tanking.
While tanking can be a successful strategy in eventually building a winning team, it alienates fans in the midst of the rebuilding process as fans are frustrated by losing teams. During the Astros' rebuilding years of 2011-2013 when they lost an average of 108 games per season, attendance was cut in half and one game had a television rating of 0.0. The Sabres have also seen dips in attendance since their alleged rebuilding years in the 2010s and have also been described as a "toxic environment".
Tanking can lead to strife with players' unions as tanking teams choose rookies on inexpensive contracts over free agents wanting multimillion dollar deals.
Leagues also see tanking as a threat to their existing revenue streams. The NBA, for example, sees this as a potentially major issue. One of professional leagues largest drivers of revenue generation is gate receipts from attendance.  Tanking has been shown to drastically reduce attendance and thus hurt the NBA's bottom line. 
The NBA and NHL have responded to the phenomenon in recent years by changing their draft from reverse-order to a lottery formula which is only loosely tied to the previous season's standings. Some observers have called for leagues to adopt a European-style relegation system where the worst teams are demoted to a minor league to make tanking less attractive. The NBA has even fined executives and owners for referencing the merits of losing. 
The NBA changed the way teams are given draft picks. In 2018, they decided to level the odds more at the top of the draft so that the worst team does not have the highest chance of getting the number one overall pick. This change serves to dissuade teams from intentionally losing.
Our team isn't good enough to win and we know it. So this season we want to develop and evaluate our young players, let them learn from their mistakes -- and get us in position to grab a great player. The best way for us to do that is to lose a lot of games. This draft is loaded. There are potential All-Stars at the top, maybe even franchise changers. Sometimes my job is to understand the value of losing.