Well, Rapperswil was smart enough to get Jeff Tomlinson as a coach 6 years ago and let him slowly build this team after they were relegated in 2015, targeting the right players and putting them in a position to succeed. What you're seeing today is the result of 6 seasons of smart decisions rather than a team suddenly performing a miracle run. Plus he has a pretty serious health condition, it probably plays a part in motivating the players.
On the other hand, Lugano is not your average 2nd place team, the standings were so close between the 2nd and 8th place that a few lucky bounces could be the difference between 2nd place and not having home ice advantage (see the last game vs Ambri, which they won on an own goal during a delayed penalty call with 2 minutes left). Plus they have a very mediocre coach who overplayed his best players during the regular season to get the 2nd place only to have them out of gas during the playoffs, never tried to change the course of a game by mixing his lines or calling a time out, always relaying on his underpeforming first PP unit for 90 seconds while the 2nd one was creating more in 30 second, and too tactically inept to avoid his opponent adapting to his "let's send everyone in front of the net and throw the puck there" system.