Origin and manipulation of the Rashba splitting in surface alloys