I'm not sure either but from tidbits of interview articles:
1. Order from management to promote certain artistes (ie Producer have series - 620/Catherine Tsang/Tommy Leung suggest to cast certain artistes)
2. Producers sees the certain artiste performance in other series and offer a role
3. Recommendation by main cast of the series eg A recommending his/her friend B to Producer who is looking for someone to fill a role
4. Open audition (Manager of the artiste arrange to attend after receiving notice).
Usually 4 doesn't apply for artistes who are very popular already.