2 different types of waivers here, unconditional release waivers and irrevocable outright waivers. If a player passes irrevocable outright waivers after 48 hours on the wire, then he just goes to that team's minor league system (and off the 40-man) and the team keeps paying his remaining contract as if nothing changed if he is unclaimed.
With outright release waivers, the team pays whatever is left on the contract and that player becomes an unrestricted free agent