The National Hockey League has always used a playoff tournament to determine its champion, generally opening up its playoff games to a much larger number of teams, including those with a losing regular season record in some years.
From the NHL's inception to 1920, when ownership of the Stanley Cup was shared between the NHL and the Pacific Coast Hockey Association the regular season was divided into two halves, with the top team from each half moving on to the league finals, which was a two-game total goals series in 1918 and a best-of-seven series in 1919.
With the merger of the PCHA and WCHL in 1925 and its collapse in 1926, the NHL took sole control of the Stanley Cup, and from this point the NHL playoffs and the Stanley Cup playoffs are considered synonymous.
The newer NBA has had playoffs since 1950.
I could find no indication of why playoff systems were used. Hockey had the Stanley Cup between rival leagues. The NBA may have simply copied the hockey model.
The NFL had a single championship game from 1933 through 1964 between the eastern and western conferences, similar to baseball's World Series structure.