Its a complicated system. The favoritism happens at the very top - Manisha or Vats. The 'creatives' or the writers who are hired to write the show, prepare scripts for Salman, and overall show design (tasks, timing, twists, etc.) work at a much lower level. So, basically, they themselves are in a tough spot because their boss's boss's boss has instructed them that, for example, Shukla has to look like a hero even though his actions are negative. Thus, they start with the Salman favoritism nonsense (since Sallu holds alot of massy authority) and they design the show around showcasing Shukla. Remember the two week period on BB13 when we only saw Asim during tasks (which was minimal) and the entire episodes revolved around SidNaaz drama? That's because they had a story to tell according to their instructions. The fact is - all contestants live in the house for the exact number of hours every day, 24, so the whole argument of "he is running the show" and "tum dikhte hi nahee ho" can be very easily manipulated to fit the narrative.
By all accounts, it seems that Manisha is the key player, especially in the BB13 Shukla scenario. Last year I interacted with many Colors/Endemol employees through mutual friends as well as on Twitter. Noted body positivity activist and fashion blogger Amena (@fashionopolis) and I also talked alot. She has friends in Colors who are high ranking and even she confirmed everything I was hearing from my contacts. Here's the timeline of the show's evolving narrative:
1. From the very start, at the planning stage, the show was designed to be a platform for a Shukla/Rashami rivalry. They were both part of a successful show and had generated public interest due to media buzz. Also, Colors had worked with them and knew that they were volatile personalities who will be bound to give 'content.' They also planned to insert some more interest in the show by introducing Arhaan Khan as a wildcard. I like Rashami and I don't want this to turn into a fanwar - but remember - Rashami pretended to be just friends with Arhaan in the beginning, initiated a love storyline, and they even teased a proposal. Then, after Arhaan's personal life came out - both admitted that they had been together since before the show. Point is - they played along.
2. Contracts Contracts Contracts. I have a background in social media marketing and some basic PR, so I have absolutely no doubt that Shukla was signed to be a winner. The amount of hoops the show jumped through to justify his trash. Musogyny, sexism, violence, homophobic jokes, kaamchori, special treatment, disproportionate screentime, one-sided biased promos - they gave Shukla everything to make people like him. Also, lets face it - those of us who are involved enough to see through their plans are the minority. Shukla's current popularity after the show is proof of this. Most people just watch, consume, accept the narrative, and move on.
3. The show began with the 'Bed Friends Forever' nonsense primarily designed to create sparks between Shukla and Rashami. This was a disaster PR-wise, and got shut down pretty quick.
4. With Arhaan in the picture, the show began cutting episodes to highlight differences between Shukla and Arhaan, trying to show Shukla as positive. When Rashami became less interested in providing content and just started chilling (I am sure she got a finale minimum guarantee contract too), the show then started doing weird stuff to trigger her, they eliminated her despite her winning votes, started bringing out her personal life (past contractual disputes, bankruptcy, etc.), and then of course the Arhaan's family thing. All to highlight Arhaan negatively.
5. The dark horse - Asim Riaz. Somewhere along the way, the makers realized that this random kid they signed the day of the premier shoot had somehow emerged as one of their major organic stars. I am sure Colors would love to capitalize - who doesn't want a brand new star they can use for years on TV, shows, etc. Problem is - he became the star by opposing Shukla. Shukla had both the contract and Manisha on his side, so they began actively promoting the Sid/Asim rivalry as the main theme. TRP was soaring and extension was announced. Then a terrible situation started - they realized that no matter how much they portray Asim negative in promos, Shukla just can't manage his own behavior and ends up looking bad. With the pushing, bullying, family insults, it became too much and they began worrying about Shukla's image - which is important because they needed him to win votes. So, randomly, more than halfway into the show they did the unthinkable (by traditional rules of content creation) - they deliberately began to undercut their own big star. Asim lost massive amounts of screentime. Vikas Gupta was involved and Asim was given a lose-lose task that VG manipulated to put the blame on him. Also, later on, they tried one last time by saying that he had cheated on his girlfriend during a very strategically planned time - after a Himanshi visit and before the press conference task.
6. SidNaaz. Luckily for the show, they had something to show in order to reduce Asim's screenspace, and that was SidNaaz. Sana was entertaining and Shukla was already getting along with her. So they decided to cut down the tasks for a few weeks (again, going against their own show rules) and focused entirely on SidNaaz for a few weeks. This was one way to keep TRPs while avoiding Shukla/Asim conflict which always makes Shukla look bad. Smart move by Colors. The couple's huge popularity to this day is proof about how well they succeeded at this stage. Also, needless to say, it also shows how gullible the audience is and how powerful media can be in mass manipulation.
7. Eventually, they were not able to completely kill Asim's momentum. He ended up second. Rashami reached the finale and was immediately eliminated. Bare contractual minimum karke nikla diya. Arti Singh, who is probably the worst finale-reaching non contributing contestant in show history reached the finale. Paras was smart to take the briefcase, as he had already figured out the jhol. Sana ended up third - quite an achievement for a relative nobody among popular TV faces. Shukla won, as per plans, and as we can see the relationship with him and the channel is still in excellent terms.
Sorry for the long post, but this is a perfect example of how complicated favoritism could be. Its a very long and messy ongoing system involving boss's instructions, constant rewriting, daily search for content, contracts, and editing manipulation. So, the original answer to your question "what is the formula" is impossible to answer. If Asim never went against Sid, he would be heavily favored but probably wouldn't reach the finale. If Sana went against Sid very strongly like Asim and never went back - she would be the non-favorite. If Arti didn't do all Sid's work and support him blindly, then she would be thrown out literally days after the family round. Sab kuch kelie agenda hota hai. There is no formula.