The slay on-hit item property on a weapon causes a creature hit by the weapon to be killed if it matches the type of creature specified in the property name. There are three ways in which creatures can be specified — by alignment, by alignment group (e.g. good), and by race. The effect ignores immunity to death magic (though saving throw bonuses versus death still apply).
There is also a property sometimes called "slay rakshasa", but this is a scripted property (officially called "blessed bolt"), while the official "slay" property is hardcoded.