Good question, don't know if I can answer it but will do my best.
There are hard and soft RTOS.
The main difference per definition is that a hard RTOS will always process an task within its predefined timeframe/deadline, it is fully deterministic in behavior.
A soft RTOS will on average handle the process within its predefined timeframe/deadline but it can run late on occasion.
Now this is a very vague definition since it is not only the RTOS responsibility but also the programmer. The programmer should make sure that the critical tasks that need to be performed within the predefined timeframe/deadline have the highest priority and shall never run longer than said predefined timeframe/deadline in order to prevent blocking other critical tasks to be processed.
This means that you need to analyze the pieces of software running, determine which ones are time critical and need to be executed within the predefined timeframe/deadline , measure the time these tasks need, if they are too large you should redesign and prioritize those tasks.
Now this is a simple explanation, as you can see that the predefined timeframe/deadline is the smallest part, this also depends on the hardware it runs.
If you get a twice as fast microprocessor the time of the tasks can be almost halved (never will due to overhead).
So it is a combination of the RTOS itself, the programmer/software and the hardware.