Teams was built from Skype. The fundamental infra for communication (chat, video call) was pulled out of Skype as a separate component and integrated into both. Skype the client is completely sunset, but a part of its back-end will continue to be used.
Teams came from Skype. Skype Lync was just a client (so far as I know). Don't take my word for it though, I was not there during the transition, this is just my understanding from talking to the ones that were.