All damage in League is classified as either magical, physical or true damage. Similarly to this, all damage also has another classification to determine those things you are confused about:
Spell damage: Damage done by abilities. These all apply spellvamp and proc rylais slow.
Basic attack damage: Not sure how to call this, but this is the damage type for basic autoattacks but also abilities that explicitly proc on-hit effects like gangplanks parrrley and Ezreals Q. If an ability enhances an autoattack, they also fall under this type of damage.
Apply lifesteal and on-hit effects like the bonus damage from wit's end.
Mutually exclusive with spell damage (damage is never both spell and basic attack damage).
Other: Some damage like the extra damage from wit's end fall under neither of these and will not benefit from spellvamp nor lifesteal. They're a third damage type that doesn't interact with special fancy effects like lifesteal, spellvamp, liandrys etc.
**
Sidenotes:**
Liandry's torment is weird and will proc on magic damage, not necessarily spell damage.
These damage types are unrelated to whether the damage is physical/magical or true. A lot of champion abilities deal physical damage but almost all of them are spell damage. They still benefit from spellvamp/rylai's slow and not lifesteal. Examples are Talons WR, Rivens QWR, Pantheons QE.