I don’t think this is only by luck. Singapore made the decision to ‘pay the bureaucrats well’ so that they can build a career on it. This attracts more people to be a bureaucrat. The alternative is that only already rich people become politicians and bureaucrats or bureaucrats only getting their bag by joining lobbying firm after their time in government.
IMO, the hard part about implementing this ‘pay the bureaucrats well’ system is that it is often hard to determine the market rate as there are often no equivalent roles in the private market.