Samurai Sword is a human-devil hybrid who merged with the Katana Devil. His grandfather was killed by Denji and because of that he affiliated with the Gun Devil to get revenge on Denji.
(Source: Chainsaw Man Wiki)