IIUC, it's both, but you're right lubrication is not it's primary purpose, but I think the reason leaded fuel is hard to replace is that the lubricating properties are difficult to replicate.
> wherein it served as an effective antiknock agent and reduced exhaust valve and valve seat wear.