Confused between 2 phase locking and 2 phase commit

I understand that both algorithms are very different, but what I don’t understand is whether they achieve the same thing in the end. 2PC is for atomic commits and 2PL is for serializable isolation. But don’t they both achieve the two things? don’t these goals imply each other in the end?